Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rows Count of a particular column

Hi all,

Sorry for this stupid question. Is it possible to count the number o
rows of a particular column?

I wrote:
1) Worksheets("Settings").UsedRange.Columns(1).Rows.C ount
2) Worksheets("Settings").Columns(1).Rows.Count

Neither works correctly. (first one gives 244, which it should give m
54 for the first column; second one gives 65536.)

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Rows Count of a particular column

Dim lCol as Long, rng as Range
lCol = 1
With Worksheets("Settings")
set rng = .Range(.Cells(1,lCol),.Cells(rows.count,lCol).end( xlup))
End With
msgbox rng.rows.count

--
Regards,
Tom Ogilvy

"kaon " wrote in message
...
Hi all,

Sorry for this stupid question. Is it possible to count the number of
rows of a particular column?

I wrote:
1) Worksheets("Settings").UsedRange.Columns(1).Rows.C ount
2) Worksheets("Settings").Columns(1).Rows.Count

Neither works correctly. (first one gives 244, which it should give me
54 for the first column; second one gives 65536.)

Thanks.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rows Count of a particular column

Thanks, Tom

--
Message posted from http://www.ExcelForum.com

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
Count/Sum rows of a column depending on criteria from drop-down li YY san.[_2_] Excel Worksheet Functions 4 December 22nd 09 01:43 AM
Count NonBlank Rows with Criteria in another column [email protected] Excel Worksheet Functions 7 May 9th 09 03:04 AM
Count all rows in column with data, Except rows 1-5 Gregory Day Excel Worksheet Functions 4 March 27th 08 02:58 PM
count rows in a column for looping damorrison Excel Discussion (Misc queries) 2 April 8th 07 10:30 PM
Count the number of rows where more than one column meets set crit BarrieVoice Excel Worksheet Functions 2 July 14th 06 07:25 PM


All times are GMT +1. The time now is 11:24 PM.

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"