View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Pierre Leclerc[_3_] Pierre Leclerc[_3_] is offline
external usenet poster
 
Posts: 2
Default Is ActiveSheet in ThisWorrkbook?

Indeed the ActiveSheet is always in the ActiveWorkbook because both are visible on screen.

ThisWorkbook is the workbook within which the macro runs and the ActiveSheet is not necessarily in ThisWorkbook.

To check such a fact use an if statement:

If ActiveWorkbook.Name=ThisWorkbook.Name then.....

See all about these workbooks in my tutorial at www.excel-vba.com

Peter