Activating a sheet in VBA

Here’s the problem. You have a number of sheets that are named after Department codes. Those sheets contain the details for each department. You have reports throughout the model that refer to these department codes. You want to be able to select a cell that contains a department code and click a button that will take you to that department’s sheet.

VBA Functions

If want to see a list of the functions available in the VBA language just type

vba.

in the code window

VBA_Tip_1

You don’t need to include vba. when using the function in code.

If you see a function with a $ in its name it means it returns a string (text) eg UCase$

VBA_Tip_2

(Thanks to John Walkenbach for this tip.)

Click here to see how you can run a Macro off a Quick Access Toolbar icon.

Related Posts

Macro to save all open Excel files

Time saver

If you have a number of linked Excel files and you make a structural change (insert rows or columns) you need to save all the open files to ensure that the links are updated and retained. This can be tedious as there is no Save All option in Excel. Word has a Save All option, but not Excel.