G
Guest
Hi!
I am trying to calculate the number of visible rows in a filtered sheet.
this sheet is all the time accumulate more and more rows, and the code that
i use can not recalculate the number of visible rows unless i am selecting
the relevant cells and double click them. (first calculation is working)
The code is base on Tom Ogilvy's code found somewhere.
Dim tdy As Date
Dim Sum1 As Integer
Dim wss As Worksheet
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
Set wss = Worksheets("Sheet1")
wss.Select
tdy = Format(Date, "Short Date")
Selection.AutoFilter Field:=6, Criteria1:=tdy
Selection.AutoFilter Field:=7, Criteria1:="Day"
num1 = rng.Columns(2).SpecialCells(xlCellTypeVisible).Count - 1
Thanks for your suggestion
Eli
I am trying to calculate the number of visible rows in a filtered sheet.
this sheet is all the time accumulate more and more rows, and the code that
i use can not recalculate the number of visible rows unless i am selecting
the relevant cells and double click them. (first calculation is working)
The code is base on Tom Ogilvy's code found somewhere.
Dim tdy As Date
Dim Sum1 As Integer
Dim wss As Worksheet
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
Set wss = Worksheets("Sheet1")
wss.Select
tdy = Format(Date, "Short Date")
Selection.AutoFilter Field:=6, Criteria1:=tdy
Selection.AutoFilter Field:=7, Criteria1:="Day"
num1 = rng.Columns(2).SpecialCells(xlCellTypeVisible).Count - 1
Thanks for your suggestion
Eli