Hi guys, newbie to AHK (heard about it from Tom Scott)
im trying to use it in microsoft excel.
in excel using ctrl+pageup or pagedown switches between worksheets. however when i get AHK to use that combination
Send {Ctrl down}PageUp{Ctrl up}
it instead opens format cells
its an up to date version, i am on a laptop (it shares a physical key with the 9 but ctrl+9 only minimises a row
any idea how to get the desired outcome of switching worksheets?
Thanks
[Mod edit: Moved to 'Ask For Help'.]
Excel-AHK
-
- Posts: 1
- Joined: 24 Jul 2020, 23:53
Re: Excel-AHK
Didn't tested it, but try:
...there may occur a problem, when you're in cell edit mode (F2)
Code: Select all
Send {Ctrl down}{PageUp}{Ctrl up}
Re: Excel-AHK
Code: Select all
ComObjActive("Excel.Application").ActiveSheet.Next.Activate ; activate next
Code: Select all
ComObjActive("Excel.Application").ActiveSheet.Previous.Activate ; activate prev.
Code: Select all
ComObjActive("Excel.Application").ActiveWorkbook.Worksheets(3).Activate ; activate #3
Code: Select all
ComObjActive("Excel.Application").ActiveWorkbook.Worksheets("Sheet2").Activate ; activate sheet2
Re: Excel-AHK
As per @aifritz's comment, this is correct; it is what I use as well; where "Page Up" is written as PgUp.aifritz wrote: ↑25 Jul 2020, 01:22Didn't tested it, but try:...there may occur a problem, when you're in cell edit mode (F2)Code: Select all
Send {Ctrl down}{Pgup}{Ctrl up}
But, I much prefer @Datapoint's solution of using COM. Where you can, try to learn the COM method, rather than keystroke replication. Right now, I am going through and updating my scripts to shift towards COM, so it's better to avoid rework!
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey
