sindhuja
07-31-2009, 09:47 AM
Hello Everyone...
I have used the below coding to get the count of the values using autofilter..
Selection.AutoFilter Field:=5, Criteria1:="In"
CountVisRows
Selection.AutoFilter Field:=5, Criteria1:="Out"
CountVisRows
Sub CountVisRows()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
Dim a As Integer
a = rng.Columns(1). _
SpecialCells(xlCellTypeVisible).count - 1
MsgBox a
End Sub
Now I need to save the count in the different sheet. I should find for the last used cell in a row and assign the count of “in” and “out” in the specific column.
The sheet will of the below format
7/26/09 7/27/09 7/28/09
In Out In Out In Out
5 2 9 3
In the above format last used cell is with the value 3, then the “in” and “out” values should be in the next cell respectively.
-Sindhuja
I have used the below coding to get the count of the values using autofilter..
Selection.AutoFilter Field:=5, Criteria1:="In"
CountVisRows
Selection.AutoFilter Field:=5, Criteria1:="Out"
CountVisRows
Sub CountVisRows()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range
Dim a As Integer
a = rng.Columns(1). _
SpecialCells(xlCellTypeVisible).count - 1
MsgBox a
End Sub
Now I need to save the count in the different sheet. I should find for the last used cell in a row and assign the count of “in” and “out” in the specific column.
The sheet will of the below format
7/26/09 7/27/09 7/28/09
In Out In Out In Out
5 2 9 3
In the above format last used cell is with the value 3, then the “in” and “out” values should be in the next cell respectively.
-Sindhuja