+ Reply to Thread
Results 1 to 3 of 3

Right One Sheet

  1. #1
    Registered User
    Join Date
    05-26-2005
    Posts
    56

    Right One Sheet

    I need to write a macro that makes the code go one sheet to the right. Normally i would just select Sheets("Sheetname").select but this macro will be used to add more sheets in.

    Any Ideas?

  2. #2
    Chip Pearson
    Guest

    Re: Right One Sheet

    Try something like

    Sub AAA()
    On Error Resume Next
    If Not ActiveSheet.Next Is Nothing Then
    ActiveSheet.Next.Activate
    Else
    Sheets(1).Activate
    End If

    End Sub

    This will select the sheet to the right, if there is one. If
    you're at the last sheet, it will loop around to the first sheet.

    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "chalky" <chalky.2b8wj6_1153401309.0347@excelforum-nospam.com>
    wrote in message
    news:chalky.2b8wj6_1153401309.0347@excelforum-nospam.com...
    >
    > I need to write a macro that makes the code go one sheet to the
    > right.
    > Normally i would just select Sheets("Sheetname").select but
    > this macro
    > will be used to add more sheets in.
    >
    > Any Ideas?
    >
    >
    > --
    > chalky
    > ------------------------------------------------------------------------
    > chalky's Profile:
    > http://www.excelforum.com/member.php...o&userid=23758
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=563277
    >




  3. #3
    Registered User
    Join Date
    05-26-2005
    Posts
    56
    Ah thank you very much!

+ 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