{"id":12101,"date":"2011-12-04T14:00:13","date_gmt":"2011-12-04T14:00:13","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=882"},"modified":"2011-12-04T14:00:13","modified_gmt":"2011-12-04T14:00:13","slug":"how-to-create-a-simple-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/12\/how-to-create-a-simple-macro\/","title":{"rendered":"Excel Macro Tutorial : How to write Excel Macro – Your First Excel Macro"},"content":{"rendered":"
Dear Readers, 4. Visual Basic Editor in Excel<\/a><\/p>\n 5. How to add different types of controls like Text Box, Radio button, button etc. in Excel<\/a> \nYou have got all the basic concept about Excel Macro. So now I will show you, how you can start writing Excel Macros. Step 1.<\/strong>First go to Visual Basic Editor of your workbook (How to open Visual Basic Editor??<\/a>) \n
\n
\nTill now we have learnt following things in Excel Macro Tutorial <\/a><\/strong>. In this part of Tutorial you are going to learn how to open the VBE Code Window<\/strong> in Visual Basic Editor<\/a> of your Workbook and start writing your first macro.
\n
\n1. What is Excel Macro ?<\/a>
\n2. How to Record Macro \/ How to Run Macro<\/a>
\n3. Add Developer Tab in Excel \u2013 2007 and 2010<\/a><\/p>\n
\n6. VBA Control Property<\/a><\/p>\n
\nExample: You are going to write your first Excel Macro. By running that Excel Macro you will add the Value of Cell A1 and A2 and multiply that Sum with the Value of Cell A3. Store this Result in Cell A4. This is your requirement to write Macros. <\/strong>
\n
\nFollow the below Steps, to write your first Excel Macro an Achieve the above mentioned requirement<\/strong>
\n<\/p>\n
\nStep 2.<\/strong>Double Click on the Sheet Name under VBA Project<\/strong> in right side of the Visual Basic Editor.
\nStep 3.<\/strong> Copy and Paste the below Code in the Code Window
\n<\/p>\nSub My_First_Macro()\nRange(\"A4\").Value = (Range(\"A1\").Value + Range(\"A2\").Value) * Range(\"A3\").Value\nEnd Sub<\/code><\/pre>\n