Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Unknown column length

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 185
Default Unknown column length

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
DTHIS
web:
www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog


"Jock" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Unknown column length

why bother?

=COUNTIF(B7:B65536,Z8)

covers all cases
--
Gary''s Student - gsnu200752


"Jock" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Unknown column length

one option is to use a dynamic range. check debra's site

http://www.contextures.com/xlNames01.html

--


Gary


"Jock" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Unknown column length

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


On Oct 29, 10:04 am, Jock wrote:
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
SMALL() on unknown length of list [email protected] Excel Worksheet Functions 9 November 1st 06 02:03 PM
Merge to Columns with Unknown length Steve M[_9_] Excel Programming 5 June 6th 06 06:58 PM
How do I sum a column of unknown length using a macro SandyPaul Excel Programming 1 October 26th 05 09:15 PM
Sum unknown length column data in VBA John[_80_] Excel Programming 3 June 26th 04 03:32 AM


All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"