Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

Excel Macro — Visual Basic Editor

The first ques­tion will be where do we write the code , Open the Excel and then press “Alt+F11” and you will get the another win­dow named as “Microsoft Visual Basic” and press “Alt+F11” and you will get back to Excel window.

VBA Edi­tor has 3 main windows:

  1. Project Win­dow
  2. Code Win­dow
  3. Prop­er­ties Window

Project win­dow and Prop­er­ties win­dow gen­er­ally appears on the left side of the Edi­tor. You can close them any time you want and to get them back all you need to do is

  • For Project Win­dow : View-> Project Explorer ( Short­cut : Ctrl+R)
  • For Prop­er­ties Win­dow : View->Properties Win­dow ( Short­cut : F4)

 

Excel-VBA -Project and Property Window - 1

Excel-VBA –Project and Prop­erty win­dow short­cuts — 1

You can cus­tomize the loca­tion of these win­dows just by click+Hold+drag on the header of the win­dow, Just make sure that its Dock­able prop­erty is Checked ( right click on the header of of the win­dow and Check “Dockable”).

Project Win­dow:

Now if you observe at Project Explorer, you can see you VBAProject(“Book1”), yes that’s your excel workbook.

Excel-VBA - Project Window -2

Excel-VBA — Project Win­dow –2

Expand VBAProject(“Book1”) -> Expand Microsoft Excel Objects -> Dou­ble Click “Sheet1(Sheet1)” and you will white screen appeared on the right side and this white screen is called “Code Window”

Excel-Macro - Code Window-3

Excel-Macro — Code Window-3

Change the Work­Sheet Name:

Go back to Excel and change the name of the sheet

Excel Macro -Change Sheet Name-4

Excel Macro –Change Sheet Name-4

You can dou­ble click on “Sheet1” and change the name or right click on “Sheet1” and select Rename and enter the new name

Excel Macro - Change Sheet Name-5

Excel Macro — Change Sheet Name-5

And now if you notice the Project Window

Excel Macro - Change Sheet Name-6

Excel Macro — Change Sheet Name-6

 Project Win­dow:

Now if you observe at Project Explorer, you can see you VBAProject(“Book1”), yes that’s you Excel workbook.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: