Thread: Right One Sheet
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default 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"
wrote in message
...

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