Loop through all sheets in an active workbook

In this snippet of code we loop through all the sheets in the active workbook. We could use this “shell” code to do something like get all the sheet names in a workbook or perform some action on each sheet etc.

Loop through all open workbooks

In this snippet of code we loop through all currently open workbooks.

Loop through all files in a given folder

In this snippet of code we loop through all files in a given folder. We could use this to open all xls files in a folder and perform some action in each file then save and close the file.

Loop through all named ranges in the current workbook

In this snippet of code we loop through all named ranges in the current workbook.

Loop through all comments in a workbook

In this snippet of code we loop through all comments in a workbook.