View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Detecting Selected WorkSheet

Anyway, all kidding aside, the problem you describe can be done using the
selection object as I originally stated:

Sub Tester2()
Dim shts As Sheets
Dim sh As Worksheet
Set shts = Worksheets(Array("Sheet1", "Sheet2", "Sheet3"))
Set sh = ActiveSheet
shts.Select
Range("A1").Select
Selection.Formula = "=Sum(C1:C30)"
sh.Select

End Sub

but also, in general, grouping sheets in vba (as above) is not supported.

--
Regards,
Tom Ogilvy

Tom Ogilvy wrote in message
...
No, you mis-understand. Excel VBA doesn't support this. I described a
workaround.

Got-it

--
Regards,
Tom Ogilvy

LeoNgan wrote in message
...
No .. you mis-understand my meaning ..

in Excel you can select multiple worksheet by click the tab with shift
button (Sheet1, Sheet2, Sheet3, etc) and then apply function on them.

Now I would like to write a macro, which effect to the user's selected
worksheet. It is a dynamical situation.

Got it ??

:)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/