Thursday, July 22, 2010

How open visual basic editor (VBE) in Excel?

After recording and playback as many as you like for sure you wanted to know what code behind so that you do the editing and write your own code to suit your needs. In order to do that we must know how open visual basic editor (VBE) from excel. There are many ways to do that:
  1. Use short cut key by pressing Alt + F11
  2. Point to Macro on the Tools menu and select Visual Basic Editor



  3. Click Visual Basic Editor Icon at Toolbar (As below image)



Now the editor is open.



Normally you won't be able to see the code immediately because still hiding under Modules folder. Now double click this folder you will see module1 or just click at plus sign beside this folder. Click this module1 and now you will see the code as below:



The above code example is from our previous macro recorded. The process as below:
  • Select Range A1
  • Fill with Red colored
  • Select Range A2
  • Fill with Green colored
  • Select Range A3
  • Fill with Blue colored
  • Select Range A1 again
Basically VBA code start with Sub (Open), macro name, some note(Start with hyphen(')), active code and End sub (Close).
Now you can start the editing. Good luck
Remember to follow the fire...

No comments:

Post a Comment