Trying to loop a subroutine through x worksheets, where x < n and n is the total number of worksheets in ActiveWorkbook. Worksheets in X have unique names (character strings). My sub keeps running on the first sheet in the book and no other. Help?
Sub countpiece()
Dim ws As Worksheet
Dim i As Long, j As Long, k As Long, g As Long, h As Long
i = 0
j = 0
k = 0
g = 0
h = 0
Application.EnableCancelKey = xlDisabled
For Each Worksheet In ActiveWorkbook.Worksheets
Select Case Worksheet.Name
Case "abur", ... (more sheet names here, not including the first, active sheet's name)(code following sheet names contains instructions for operations. Condition/repeat structure ends like this:)
Case Else
End Select
Next Worksheet
End Sub
Bookmarks