Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default identify selected worksheets

probably very simple, but I can't quite work it out.

If more than one worksheet is selected, the code for whis action would
be:

Sheets(Array("Sheet1", "Sheet2")).Select

how do i access this information. (I would like to apply changes to
Sheet1 and Sheet2, and not to Sheet3)

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default identify selected worksheets

Code acts on only one sheet at a time. If you want to update multiple sheets
you need to write code traverse through those sheets individually.
--
HTH...

Jim Thomlinson


"brzak" wrote:

probably very simple, but I can't quite work it out.

If more than one worksheet is selected, the code for whis action would
be:

Sheets(Array("Sheet1", "Sheet2")).Select

how do i access this information. (I would like to apply changes to
Sheet1 and Sheet2, and not to Sheet3)

thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default identify selected worksheets

Thanks, though my question was how to work out which sheets are
selected. i.e. how do I work out which sheets to traverse?

I can't do this for example:

Dim A as Worksheet

For Each A in Selection
'Actions
Next A

Cheers


On Jun 23, 4:31*pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Code acts on only one sheet at a time. If you want to update multiple sheets
you need to write code traverse through those sheets individually.
--
HTH...

Jim Thomlinson

"brzak" wrote:
probably very simple, but I can't quite work it out.


If more than one worksheet is selected, the code for whis action would
be:


* * * Sheets(Array("Sheet1", "Sheet2")).Select


how do i access this information. (I would like to apply changes to
Sheet1 and Sheet2, and not to Sheet3)


thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default identify selected worksheets

Dim sh As Object

For Each sh In ActiveWindow.SelectedSheets

MsgBox sh.Name
Next sh


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"brzak" wrote in message
...
Thanks, though my question was how to work out which sheets are
selected. i.e. how do I work out which sheets to traverse?

I can't do this for example:

Dim A as Worksheet

For Each A in Selection
'Actions
Next A

Cheers


On Jun 23, 4:31 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Code acts on only one sheet at a time. If you want to update multiple
sheets
you need to write code traverse through those sheets individually.
--
HTH...

Jim Thomlinson

"brzak" wrote:
probably very simple, but I can't quite work it out.


If more than one worksheet is selected, the code for whis action would
be:


Sheets(Array("Sheet1", "Sheet2")).Select


how do i access this information. (I would like to apply changes to
Sheet1 and Sheet2, and not to Sheet3)


thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default identify selected worksheets

Sub which_ones()
For i = 1 To ActiveWindow.SelectedSheets.Count
MsgBox (ActiveWindow.SelectedSheets(i).Name)
Next
End Sub

--
Gary''s Student - gsnu200793


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default identify selected worksheets

Ah great, I didn't think to use ActiveWindow, I looked down the full
list of Worksheet/Sheet object members (at least three times) but
found nothing.

I'll have to keep ActiveWindow in mind for the future - seems to have
a lot of useful properties.

Thanks guys!

On Jun 23, 5:14*pm, Gary''s Student
wrote:
Sub which_ones()
For i = 1 To ActiveWindow.SelectedSheets.Count
* * MsgBox (ActiveWindow.SelectedSheets(i).Name)
Next
End Sub

--
Gary''s Student - gsnu200793


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
Cross reference two worksheets to identify matches Christie Excel Worksheet Functions 4 January 14th 09 08:38 PM
Identify selected chart Michael Singmin Excel Programming 3 March 14th 05 10:59 AM
Need to identify object selected. Neil Bhandar[_2_] Excel Programming 3 January 17th 04 06:50 AM
Identify User Selected Range RonF Excel Programming 3 January 12th 04 04:36 PM
Identify Range Selected By User RonF Excel Programming 1 January 9th 04 05:29 PM


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