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.....
|