Discussion Locked

Macro for Cycling through Excel Sheets

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I need a Macro (Button) that lets when pressing it jump to the next sheet. When last sheet selected it should jump to the first one. I guess it needs to be done with a script just dunno how.

3 replies

by steved

Here's a script that will accomplish what you ask:

Sub NextSheet()
Dim i As Integer
Dim s As String
s = ActiveSheet.Name
If Sheets(s).Index = Sheets.Count Then
i = 1
Else
i = Sheets(s).Index + 1
End If
Sheets(i).Select
End Sub
I hope this helps.

Steve Diamond

This discussion is closed to new replies.