View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
simpleMacros simpleMacros is offline
external usenet poster
 
Posts: 1
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.....