I havea macro to loop through all the sheets in a workbook and apply a fliter in column C. the filter is by Date and all sheets have the exact same format. For some reason the macro will go through the loop but not change to the next sheet. The message box line however does go from sheet to sheet.
Sub WorksheetLoop()
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.count
For I = 1 To WS_Count
Range("C1").Select
Selection.AutoFilter
ActiveWindow.LargeScroll ToRight:=-1
ActiveSheet.Range("$A$1:$N$4178").AutoFilter Field:=3, Operator:= _
xlFilterValues, Criteria2:=Array(1, "7/31/2013")
MsgBox ActiveWorkbook.Worksheets(I).Name
Next I
End Sub
I attached a 2 tab work book example. When i run the program, it only applies it to Sheet 1.
Any help would be great.
Bookmarks