Making macro, But Doesn't work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sephi07
Posts: 1
Joined: 08 Dec 2022, 07:28

Making macro, But Doesn't work

Post by sephi07 » 08 Dec 2022, 07:35

Hello, I'm a beginner, so I'm sorry that it's such a rudimentary question.

The macro I want is to use in Excel.

Press Control+Alt+V
After a slight delay, press the down button twice and press Enter.

There are other shortcuts, so I wrote them in the script together, but I'm not sure how to make this macro, so I'm asking for your help.
This is the code I made, and it doesn't work.
---------------------------------------------------

Code: Select all

NumPad1:: Send ^c
NumPad2:: 
{Send ^!v
	Sleep, 500
	Send {Down}
	Sleep, 10
	Send {Down}
	Sleep, 10
	Send {Enter}
}
NumPad7:: Send ^c
NumPad8:: Send ^v
Numpad9:: Send ^s
NumpadSub:: Send ^{F4}
NumpadDiv:: Send !{F4}
[Mod edit: [code][/code] tags added.]
---------------------------

Thanks for reading!

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Making macro, But Doesn't work

Post by mikeyww » 08 Dec 2022, 09:37

Welcome to this AutoHotkey forum!

Tips:
1. Try one hotkey subroutine first, instead of a script with seven of them. Get your one routine working before expanding.
2. Skip the bounding braces around the whole subroutine. AHK v1 uses no such syntax. Instead, end the subroutine with :arrow: Return. Example
3. If the script doesn't work:
a. Post the revision in a reply below.
b. Instead of your problem statement of "doesn't work", state what actually happens when you run the script and trigger the hotkey. Is the routine triggered at all? If so, how do you know?
c. State what should happen instead.

Code: Select all

xlPasteValues = -4163 ; https://learn.microsoft.com/en-us/office/vba/api/excel.xlpastetype
^F3::ComObjActive("Excel.Application").Selection.PasteSpecial(xlPasteValues)

Post Reply

Return to “Ask for Help (v1)”