During many occasions I use to write macro code in excel and it
will be so time consuming process or at some time it was so problematic to remember
all the syntax and keywords used while writing the code.
Very often I use to notice an option in Excel called “Record
Macros” But I don’t find any time to dig into this menu choice. Later I find
out that there is an existing feature in excel (in all the versions 2003/2007/2010)
underneath “Record Macros” to generate the macro code for whatever operation we
process in excel document. Here I will show the sample which is developed in
Excel 2007 version.
For all clarification or doubt please post your comment s and I
will get back to you very soon.
Create an Excel Macro document <filename>.xlsm in
the local path.
I will show a small sample dummy sales data as an example for
populating macro
1. Please refer the data as in the below screen shot
2. Click on the developer tab -> Records Macros, it will pop
up a small window as in the below screen shot and Click OK
3. Then I will select data and create a line chart as below.
4. Click on the developer tab -> Stop Record, it will pop up
a small window as in the below screen shot and Click OK
5. In developer tab Click on the Visual Basic Editor icon and
click on the Module item under tree menu in the visual basic editor window to
see the generate code.
No comments:
Post a Comment