Hi All,
Newbie to the forum but a long-time reader of certain parts - thank you to all contributors as you've really helped me in the past.
As part of a monster model that I've been asked to build, I've been trying to pull together a couple of Macros to help other users moving around the workbook. My coding experience is limited and normally restricted to editing recorded macros, so this is a bit of a learning experience for me.
One Macro I'd like to build is an update on "CTRL+Page Up/Page Down" but changing it to move to the first sheet in the workbook or to the last. I've currently got this mapped to CTRL+SHIFT+N/M but (because it just makes more sense to me) I'd like to map it to CTRL+SHIFT+PgUp/PgDn.
The code I've been trying is (ignoring a few 'move to cell ref' bits)
Start Sub Cleverkeys()
Firstsheet = Activeworkbook.worksheets(1).Activate
Application.Onkey "^+{PgUp}", Firstsheet
End Sub()
However, I just can't get the Onkey line to function - I'm probably trying to mix apples and pears!
Can anyone help me to build this code? Oh, and lets assume that this ignores any hidden tabs in the workbook (if I do hide any, I won't want the users to find them!).
Thanks in advance
Michael
Newbie to the forum but a long-time reader of certain parts - thank you to all contributors as you've really helped me in the past.
As part of a monster model that I've been asked to build, I've been trying to pull together a couple of Macros to help other users moving around the workbook. My coding experience is limited and normally restricted to editing recorded macros, so this is a bit of a learning experience for me.
One Macro I'd like to build is an update on "CTRL+Page Up/Page Down" but changing it to move to the first sheet in the workbook or to the last. I've currently got this mapped to CTRL+SHIFT+N/M but (because it just makes more sense to me) I'd like to map it to CTRL+SHIFT+PgUp/PgDn.
The code I've been trying is (ignoring a few 'move to cell ref' bits)
Start Sub Cleverkeys()
Firstsheet = Activeworkbook.worksheets(1).Activate
Application.Onkey "^+{PgUp}", Firstsheet
End Sub()
However, I just can't get the Onkey line to function - I'm probably trying to mix apples and pears!
Can anyone help me to build this code? Oh, and lets assume that this ignores any hidden tabs in the workbook (if I do hide any, I won't want the users to find them!).
Thanks in advance
Michael