Need some guidance on sending values in Excel to my ahk clipboard manager

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
shipaddicted
Posts: 94
Joined: 15 Jul 2016, 19:57

Need some guidance on sending values in Excel to my ahk clipboard manager

15 Jul 2016, 20:18

Hello AHKers. I am a fairly new user (just a few weeks) and I'm trying to script some things to make my work life a little easier. I have done some pretty cool scripts on my own, but I keep running into dead ends on my excel/ahk script.

Basically, what I need is this:
1. I get a daily Excel document that I convert into a usable table. Its length is variable. I need to be able to select some cells in particular columns on whatever line I happen to be in.
2. I want to send these copied cells' values to my clipboard script (basically the general clipboard script that is found here, but I have programmed all of my numpad keys & the ctrl key to hold up to 10 different variables).
-- copy value in column C to Clippy Numpad1
-- copy value in column D to Clippy Numpad2
-- copy value in column G to Clippy Numpad6
2. Then I want to automatically move on to my company's proprietary Oracle program and paste the value in Numpad1 into their search function ( have this programmed already in another script -- will modify it to fit into the finished product at a later time)
3. Then move on to my company's online inventory management software program in Google Chrome and again paste the value in Numpad1 into the search function (as above, already programmed & will merge later)

I have been able to create a macro to copy one value in the current row, but I am having difficulty sending this value to my Clippy. I have tried SendKeys, SendInput, SendMessage, and just plain Send, but none seem to just fire off the keystrokes I need to send that value to Clippy Numpad1 (which would be ^Numpad1).

I haven't even really been able to verify if I'm using the right syntax to identify that I want specifically the Numpad key and not just any 1 key. I've tried {NumPad1}, {NUMPAD1}, NumPad1, and NUMPAD1.

I don't get an error at this point, nothing happens at all at the moment. Here is my butchered up code I have gathered through much trial and error. (This obviously just shows step 1 of a much longer script to be added later!) I would love it if someone could point me in the right direction of how to send this information to my clippy in ahk.

Thanks kids! :D

Code: Select all

Sub CopyFromCols()
    'Save the current location
    Dim TargetCell As Range
    Set TargetCell = ActiveCell.Range("A1")

    'Copy from same row in C
    Cells(ActiveCell.Row, 3).Select
    Selection.Copy
    Application.Wait (Now() + TimeValue("00:00:02"))
    Send = "^NumPad1"

    'Paste to original location, as saved above
    'TargetCell.Select
    'ActiveSheet.PasteSpecial
End Sub

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, vysmaty and 245 guests