View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Is ActiveSheet in ThisWorrkbook?

More...
You do not have to activate a workbook in order to run code.
"Workbooks(2).Sheets(3).Range("A1").value2 = 1234" runs just fine without activating/selecting that
workbook.

If you do have to determine if the workbook with code is active then...
"ActiveSheet.Parent Is ThisWorkbook" returns True or False.
'---
Jim Cone


"Jim Cone"
wrote in message
...
The active sheet is always in the active workbook.
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(List Files XL add-in: finds and lists files/folders with hyperlinks)





"Charlotte E."
wrote in message
...
Is there a way to check if ActiveSheet is part of the workbook in which the a macro is located?

I have a macro which switches between 3 open workbooks, and for some reason the activesheet also
switches...

How to check if ActiveSheet is in ThisWorkbook or in ActiveWorkbook?


Thanks,

CE