I have used excel, but never have i had to use the Visual Basic Editor...how do you put the code into the worksheet? Copy and Paste?
I have used excel, but never have i had to use the Visual Basic Editor...how do you put the code into the worksheet? Copy and Paste?
Press Alt + F11 to open the VBA code window.
press CTRL + R to make sure the Project window is open
Navigate to VBAProject(bookname), where the bookname will be the name of your Excel workbook.
Doble-click on the sheet name where you want to attach the code, or ThisWorkbook if you want the code to work for all sheets. Actualy I usualy use the menu item Insert>Module. Either way a l;arge white pane should open to the right.
Paste your code in here. Note that the code should start "Public Sub somename (" or something similar, note the "somename" before the left paraenthisis.
To run, go back to your sheet and press Alt + F8. You may need to select the macro from a list, this is where you would select the line which contains the "somename" you noted above.
HTH
Art
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks