Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How do I count the number of rows selected?

I want to find out how many rows are in my selected range after issuing these
lines:

Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell).Offset(0, -1)).Select

I don't know how to go from there. Is there a row property I can use to
capture the count of rows (something like countrows = selection.rows)? As
you can tell, I'm pretty much a novice at this. Thanks in advance,
S.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default How do I count the number of rows selected?

Hi Steve

You've practically got it!!
countrows = Selection.Rows.Count
--
Regards
Roger Govier

"SteveM" wrote in message
...
I want to find out how many rows are in my selected range after issuing
these
lines:

Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell).Offset(0, -1)).Select

I don't know how to go from there. Is there a row property I can use to
capture the count of rows (something like countrows = selection.rows)? As
you can tell, I'm pretty much a novice at this. Thanks in advance,
S.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default How do I count the number of rows selected?

hi
Dim c As Long
c = Selection.Rows.Count
MsgBox c

regards
FSt1

"SteveM" wrote:

I want to find out how many rows are in my selected range after issuing these
lines:

Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell).Offset(0, -1)).Select

I don't know how to go from there. Is there a row property I can use to
capture the count of rows (something like countrows = selection.rows)? As
you can tell, I'm pretty much a novice at this. Thanks in advance,
S.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How do I count the number of rows selected?

Thank you Roger & FSt1 for the quick replies.

S.
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
How to fix a number of rows below the selected cells? sk Excel Discussion (Misc queries) 0 March 9th 10 01:56 AM
How to count the number of selected combobox within Excel? Eric Excel Discussion (Misc queries) 10 June 30th 09 09:20 AM
Copy a selected number of rows Eric S. Excel Discussion (Misc queries) 4 June 25th 07 08:23 AM
How do I check the number of rows selected [email protected] Excel Programming 4 August 8th 06 01:27 PM
Count number of selected item in Listbox Todd Huttenstine Excel Programming 4 June 14th 04 06:54 PM


All times are GMT +1. The time now is 10:24 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"