if activeSheet.Index = Sheets.count then
Sheets(1).Activate
else
sheets.Next.Activate
End if
if activeSheet.Index = 1 then
Sheets(Sheets.count).Activate
else
sheets.Previous.Activate
End if
--
Regards,
Tom Ogilvy
"nrage21 " wrote in message
...
Hi guys,
Thx a lot for all your help over the past months!!
I have an userform, and I would like to create 2 commandbuttons that
will allow the user to move from one worksheet to the next and the
other to move from one worksheet to the previous and when the last or
first worksheet is reached to keep going in circles.
i.e. if user reaches last worksheet and clicks Next to go back to first
worksheet.
I have a total of 9 worksheets, is that is important.
This is probably the easiest problem to solve, I'm sure.
- Larry -
VBA Amateur
---
Message posted from http://www.ExcelForum.com/