Forum Discussion
Sheet tabs in Excel
Thank you for your response. I don't quite understand how to do this. I have the developer tab open in excel. I went in to the Macros icon. There are no workbooks. And I don't understand the code. I see that you have them numbered, does that mean that I put those in the corresponding cells? I'm really not that techy. lol. If you could expound on how to do this I would greatly appreciate it. Maybe break it down in laymeans terms if you wouldn't mind. Again, thank youHansVogelaar
The line numbers are not part of the code.
Select the code, from Sub up to and including End Sub - you'll see that the line numbers are not included.
Copy it (Ctrl+C)
Press Alt+F11 to activate the Visual Basic Editor.
Select Insert > Module or press Alt+I, M to create a new code module.
Paste the code into the module (Ctrl+V).
There are two ways you can run the code:
- In the Visual Basic Editor, click anywhere in the code, then select Run > Run Macro, or press F5.
- In Excel, press Alt+F8 to activate the Macros dialog. You should now see the name of the macro that you copied/pasted.
- Click Run.
I have attached a demo workbook with a command button that will run the macro.
You'll have to allow macros when you open the workbook.