Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this code where I am trying to filter each sheet in the workbook
on column "I" for 2006, except the first sheet. I am not quite there. Need help. TIA Sub Filter2006() Dim sh As Worksheet With ActiveWorkbook For Each sh In Worksheets If sh.Name = "IS Time Q1_06" Then Else Range("A1:L1").Select Selection.AutoFilter Selection.AutoFilter Field:=9, Criteria1:="2006" End If Next sh End With End Sub Greg |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try:
Sub Filter2006() Dim sh As Worksheet With ActiveWorkbook For Each sh In Worksheets If sh.Name < "IS Time Q1_06" Then Range("A1:L1").Select Selection.AutoFilter Selection.AutoFilter Field:=9, Criteria1:="2006" End If Next sh End With End Sub ----------------------------------------------------- "GregR" skrev: I have this code where I am trying to filter each sheet in the workbook on column "I" for 2006, except the first sheet. I am not quite there. Need help. TIA Sub Filter2006() Dim sh As Worksheet With ActiveWorkbook For Each sh In Worksheets If sh.Name = "IS Time Q1_06" Then Else Range("A1:L1").Select Selection.AutoFilter Selection.AutoFilter Field:=9, Criteria1:="2006" End If Next sh End With End Sub Greg |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent, I thought the statement means
If sh.Name = "IS Time Q1_06" Then "do nothing" Else Code "do something" Is my thinking mistaken Greg |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
well i think its the other way round :-)
|
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent, there is also somethig about the filter, some how each sheet
needs to be activated in the loop for the filter to be applied????? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
y ur right i just notest :-)
For Each sh In Worksheets sh.Activate ' add this line here **** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filter problem | Excel Discussion (Misc queries) | |||
problem with filter | Excel Discussion (Misc queries) | |||
filter problem | Excel Discussion (Misc queries) | |||
filter problem | Excel Discussion (Misc queries) | |||
Filter Problem | Excel Programming |