Unknown column length

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I change this:

=COUNTIF($B$7:$B$2000,Z8)

to something which will 'detect' the max row numberin column 'B'?
2000 is an arbitrary figure and will fluctuate either way so I was looking
for a 'catch all'

Thanks,

Traa Dy Liooar

Jock
 
Jock

If the data is contiguous then

=COUNTA(B:B)

will give you the number of rows in ColumnB with data, if there are gaps, it
will still return a number, but will not count the blanks

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
web: www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog
 
If there are no empty cells in your list this will report out the
exact sheet row number:

Dim nRow As Integer
Range("B7").Select
Selection.End(xlDown).Select
nRow = Selection.Row
MsgBox nRow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top