Using RegExReplace for creating an Array
Posted: 14 Jun 2018, 14:18
Hello,
I would like to create an Array which consists of Excel cells.
When I'm in Excel, I simply would like to press a key which copies the current cell name.
Additionally, the copied cell name must be modified.
After that was done, the info should be sent to Notepad++.
An example:
Cell name: K4
The result should be: "K4", (with space at the end)
I already had partial success.
I guess I don't need the m and n inside of the RegExReplace, because it's only a single line and only a single word.
Can you help, please?
P.S. I know COM is probably the better way, but it's too advanced for me. This method here would be fine for me, when it works...
Regards
I would like to create an Array which consists of Excel cells.
When I'm in Excel, I simply would like to press a key which copies the current cell name.
Additionally, the copied cell name must be modified.
After that was done, the info should be sent to Notepad++.
An example:
Cell name: K4
The result should be: "K4", (with space at the end)
I already had partial success.
Code: Select all
F1::
MouseGetPos, xx, yy ; Get current mouse position
Sleep, 5
MouseMove 111, 153 ; Move cursor to cell name field
Sleep, 5
Send {lbutton} ; Click inside of field
Sleep, 20
Send ^c ; Copy cell name
Sleep, 5
Clipboard := RegExReplace(Clipboard,"m`r`n)^.*$","'$0',") ; Modify value -> here I need help! <-
Sleep, 5
Send {Esc} ; Exit field
Sleep, 5
ControlSend, Scintilla1, ^v, ahk_class Notepad++ ; Send copied value to Notepad++
Sleep, 5
MouseMove, xx, yy, 0 ; Move mouse cursor to original position
return
Can you help, please?
P.S. I know COM is probably the better way, but it's too advanced for me. This method here would be fine for me, when it works...
Regards