+ Reply to Thread
Results 1 to 8 of 8

Keyboard shortcut for switching through worksheets

  1. #1
    Registered User
    Join Date
    02-05-2010
    Location
    zagreb
    MS-Off Ver
    Excel 2003
    Posts
    3

    Keyboard shortcut for switching through worksheets

    Hello!

    I need keyboard shortcut for switching through worksheets.

    For now, I have this VBA macro and shortcut Ctrl+R:
    Please Login or Register  to view this content.
    But, there is a problem: when i am on the last sheet, and want to go to the first, there is Error.

    Any suggestions?

    Thanks in advance.

    Sinke
    Last edited by sinke; 02-19-2010 at 03:48 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Keyboard shortcut for switching through worksheets

    You can actually use Ctrl+Page Down or Ctrl+PageUp for that (it has the same limitation), or just use the sheet navigation buttons in the bottom left corner?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Keyboard shortcut for switching through worksheets

    sinke, Welcome to the Board,

    Your post does not comply with Rule 3 of our Forum RULES.
    Use code tags around code.
    Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window.

    For more information about these and other tags, found here

  4. #4
    Registered User
    Join Date
    02-05-2010
    Location
    zagreb
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Keyboard shortcut for switching through worksheets

    @DonkeyOte
    i will keep that in mind :-)

    @romperstomper
    Ctrl+Page Down or Ctrl+PageUp are very non-ergonomic (or maybe i'm just being lazy) .
    My combination Ctrl+R is much better :-))
    Any other advice??

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Keyboard shortcut for switching through worksheets

    sinke, my post was not a "suggestion".

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Keyboard shortcut for switching through worksheets

    You obviously have a different keyboard than mine...

    You would need a check to see if activesheet.Index is equal to either 1 or Sheets.Count (depending on which way you are going) and then select the relevant sheet rather than the previous/next.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Keyboard shortcut for switching through worksheets

    if you must then you could just use on error
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    02-05-2010
    Location
    zagreb
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Keyboard shortcut for switching through worksheets

    martindwilson , thanx for helping. your code for Next_sheet works fine.

    For Previous_sheet i use:

    Please Login or Register  to view this content.
    I don't konw how to define "last sheet", so it jumps to 3rd sheet.
    This is not a perfect solution , but for me is good enough. My problem is solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1