Quick Immediate Window Commands useful for debugging

Vishesh's picture

1. When you have a form open and you encounter an error and you want to go to the excel sheet

You need to hide the form first before you can click on the sheet


2. If you want to activate a sheet other than the current activesheet its better to use sheet code name than the names which are displayed in sheet tabs


3. To display/hide sheet tabs

    ActiveWindow.DisplayWorkbookTabs = True

4. If you are working on more than one workbooks, then to activate a particular workbook


5. Close a workbook with/without saving

    Workbooks("WorkbookNameInString").Close False 'To close without saving>

6. To display the value of a variable

    ?variable name

7. To display the address of range variable

    ? Range("RangeName").Address

8. To show hidden columns

    Columns("D:H").Hidden = False

....will keep adding more to this list