Code: Select all
Sub Update()
.........
ActiveSheet.Next.Select
Call Update
End Sub
Code: Select all
Sub Update()
.........
ActiveSheet.Next.Select
Call Update
End Sub
Code: Select all
If ActiveSheet.Index = Sheets.Count Then
Exit Sub
End If
ActiveSheet.Next.Select
Call Update
Code: Select all
Dim wsh As Worksheet
For Each wsh In Worksheets
... ' do something with wsh
Next wsh
Code: Select all
Dim i As Integer
For i = 1 To Worksheets.Count
... ' do something with Worksheets(i)
Next i
That would be my usual approach, but I don't want to affect all sheets, only the active sheet and those (tabs) to the right.HansV wrote:But why don't you use code like this:
Code: Select all
Dim wsh As Worksheet For Each wsh In Worksheets ... ' do something with wsh Next wsh
Code: Select all
For n = activesheet.index to Sheets.count
' do something to sheets(n)
Next n