PC Review


Reply
Thread Tools Rate Thread

How do I count the number of rows selected?

 
 
SteveM
Guest
Posts: n/a
 
      28th Mar 2009
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.

 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a
 
      28th Mar 2009
Hi Steve

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

"SteveM" <(E-Mail Removed)> wrote in message
news:32DE5A5A-02CC-4B7B-A868-(E-Mail Removed)...
> 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.
>

 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      28th Mar 2009
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.
>

 
Reply With Quote
 
SteveM
Guest
Posts: n/a
 
      28th Mar 2009
Thank you Roger & FSt1 for the quick replies.

S.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count the number of selected combobox within Excel? Eric Microsoft Excel Misc 10 30th Jun 2009 09:20 AM
How to count the number of worksheets selected? Bassman62 Microsoft Excel Programming 4 3rd Apr 2009 06:42 PM
Count number of emails selected =?Utf-8?B?UGFkbWFuYWJoYW4gSw==?= Microsoft Outlook Discussion 3 17th Jul 2007 02:39 PM
Count number of rows, where non relevant rows are hidden =?Utf-8?B?UGlldGVy?= Microsoft Excel Misc 2 8th Nov 2006 12:24 PM
Count rows and insert number to count them. =?Utf-8?B?TWV4?= Microsoft Excel Misc 6 23rd Aug 2006 02:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:43 AM.