How do you enbed a marcos or VB in a sheet?

  • Thread starter Thread starter Mike Stewart
  • Start date Start date
Hi Mike,

Right click on the sheet tab with the sheet name on it. Select View Code.
This opens the VBA editor where you can insert code for the specific sheet.
Normally you place event driven code here. When you first open the vba editor
before any code is placed here, at the top of the large white area you will
see 2 drop down boxes. One with the default General and the other with
default Declarations. If you click the arrow of the one with General, you can
select worksheet. You can then click the arrow of the other box and you will
get a list of all the events. Clicking on them will create a Private Sub name
and End sub for the particular event.
 
Right click the sheet tap and select view code after pasting / writing the
code you can close.
To run this macro go to tools macro>>run macro (Alt=F8)
you can give a name to this recorded macro for security reasons in the drop
down list (macros in) select current workbook) and click run.
 
Back
Top