I have a workbook that simulates an in-house program. There are two macros; one goes "forward" and one goes "backwards" to create a loop moving users to each visible sheet. For example,
Sheet 1->Sheet 10->Sheet 11->Sheet 1.
There are hidden sheets used as templates.
Sub Forward()
idx = ActiveSheet.Index
If Sheets(idx + 1).Visible = False Then
Sheets("Name Sequence").Select
Else
ActiveSheet.Next.Activate
End If
End Sub
Sub Backward()
If ActiveSheet Is Sheets(1) Then
ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count).Activate
Else
ActiveSheet.Previous.Activate
End If
End Sub
The intent is to have the macros cycle through and select visible sheets, moving the user to a different sheet each time they click the forward or backwards buttons.