Quick Immediate Window Commands useful for debugging

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
Me.Hide
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
Sheet3.Activate
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
Workbooks("WorkbookNameInString").Activate
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
- Vishesh's blog
- Add new comment
- 1476 reads

Recent comments
6 hours 9 min ago
9 hours 33 min ago
9 hours 56 min ago
15 hours 58 min ago
16 hours 50 min ago
1 day 7 hours ago
1 day 7 hours ago
1 day 11 hours ago
1 day 19 hours ago
2 days 14 hours ago