Right One Sheet

  • Thread starter Thread starter chalky
  • Start date Start date
C

chalky

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 macr
will be used to add more sheets in.

Any Ideas
 
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" <[email protected]>
wrote in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top