PDA

View Full Version : Solved: rows.count in a range



philfer
03-16-2008, 11:54 AM
Hello,

I am using rows.count and a range object to see how many rows autofilter returns.

However, it keeps giving me the answer as three when I can see about 30 rows.

I am using xlvisiblecells

Has anyone come acress this before? and if so how did you solve it?

Bob Phillips
03-16-2008, 12:14 PM
As ever, show the code.

Simon Lloyd
03-16-2008, 12:19 PM
This works for me:

Sub Macro2()
Dim rc As Integer
rc = Sheets("Sheet1").Range("A1:" & Range("A65536").End(xlUp).Address).SpecialCells(xlVisible).Count
MsgBox rc
End Sub