adamsm
06-29-2010, 10:32 AM
Hi,
The following code counts the visible rows. For example if 5 rows are visible out of 10 rows, it says 5 of 10 records.
Any help to change the code so that it counts half of the visible rows would be kindly appreciated.For example if 2 rows are visible the display message would be as 1 of 10 records.
If 4 rows are visible the message would display as 2 rows.
Sub CountVisRows()
Dim rng As RangeSet rng = ActiveSheet.AutoFilter.Range
MsgBox rng.Columns(1). _
SpecialCells(xlCellTypeVisible).Count - 1 _ & " of " & rng _ .Rows.Count - 1 & " Records"
End Sub
The following code counts the visible rows. For example if 5 rows are visible out of 10 rows, it says 5 of 10 records.
Any help to change the code so that it counts half of the visible rows would be kindly appreciated.For example if 2 rows are visible the display message would be as 1 of 10 records.
If 4 rows are visible the message would display as 2 rows.
Sub CountVisRows()
Dim rng As RangeSet rng = ActiveSheet.AutoFilter.Range
MsgBox rng.Columns(1). _
SpecialCells(xlCellTypeVisible).Count - 1 _ & " of " & rng _ .Rows.Count - 1 & " Records"
End Sub