PC Review


Reply
Thread Tools Rate Thread

How to count the number of worksheets selected?

 
 
Bassman62
Guest
Posts: n/a
 
      3rd Apr 2009
Using VBA, how can I count the number of worksheets selected?
I'm trying to test if there is more than one worksheet currently selected.
Thank you.


 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      3rd Apr 2009
ActiveWorkbook.Windows(1).SelectedSheets.Count

Regards,
Peter T


"Bassman62" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Using VBA, how can I count the number of worksheets selected?
> I'm trying to test if there is more than one worksheet currently selected.
> Thank you.
>
>



 
Reply With Quote
 
joel
Guest
Posts: n/a
 
      3rd Apr 2009
Num = ActiveWindow.SelectedSheets.Count

"Bassman62" wrote:

> Using VBA, how can I count the number of worksheets selected?
> I'm trying to test if there is more than one worksheet currently selected.
> Thank you.
>
>
>

 
Reply With Quote
 
Bassman62
Guest
Posts: n/a
 
      3rd Apr 2009
Peter,
Thank you very much. That's nice.
I tryed several combinations but missed the .Windows(1).
I'll study up on this term.
Thanks again.

"Peter T" <peter_t@discussions> wrote in message
news:(E-Mail Removed)...
> ActiveWorkbook.Windows(1).SelectedSheets.Count
>
> Regards,
> Peter T
>
>
> "Bassman62" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Using VBA, how can I count the number of worksheets selected?
>> I'm trying to test if there is more than one worksheet currently
>> selected.
>> Thank you.
>>
>>

>
>



 
Reply With Quote
 
Bassman62
Guest
Posts: n/a
 
      3rd Apr 2009
Thanks Joel,
This works well also.

"joel" <(E-Mail Removed)> wrote in message
news:A4480A99-3A21-46BE-AC28-(E-Mail Removed)...
> Num = ActiveWindow.SelectedSheets.Count
>
> "Bassman62" wrote:
>
>> Using VBA, how can I count the number of worksheets selected?
>> I'm trying to test if there is more than one worksheet currently
>> selected.
>> Thank you.
>>
>>
>>



 
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
Count Number of Records Selected in Subform terri Microsoft Access Forms 1 23rd Jul 2009 02:48 PM
How do I count the number of rows selected? SteveM Microsoft Excel Programming 3 28th Mar 2009 07:06 PM
Count number of emails selected =?Utf-8?B?UGFkbWFuYWJoYW4gSw==?= Microsoft Outlook Discussion 3 17th Jul 2007 02:39 PM
Count Number of times date selected =?Utf-8?B?QmVhbmVyMjAw?= Microsoft Access Queries 5 20th Apr 2005 07:09 AM
Count number of selected item in Listbox Todd Huttenstine Microsoft Excel Programming 4 14th Jun 2004 06:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:31 PM.