Visit www.qlockwork.com to try it out

How to write a VBA Macro for Excel

Anne Currie
TimeTrackingThoughts
2 min readJun 11, 2015

--

Today I’m going to do this for the first time in years — so it’s fundamentally from scratch. My first job is to get the developer tab in my Excel s/s

  1. On the File tab, choose Options to open the Excel Options dialog box.
  2. Click Customize Ribbon on the left side of the dialog box.
  3. Under Choose commands from on the left side of the dialog box, select Popular Commands.
  4. Under Customize the ribbon on the right side of the dialog box, select Main tabs, and then select the Developer check box.
  5. Click OK.

Now your developer tab should be there. You’re ready to write a macro.

First I need to create an empty macro

  1. Click the Macros button on the Developer tab.
  2. In the Macro dialog box that appears, type, Hello under Macro Name.
  3. Click the Create button to open the Visual Basic Editor with the outlines of a new macro already typed in.

Now I can write a single line, e.g. MsgBox(“hello”) and see if it will run

  1. Go back to the Developer tab in Excel and click the Macros button again.
  2. Select the Hello macro in the list that appears and then click Run to display a small message box that contains the text, “hello”

OK, that’s very basic but it’s a start!

Please hit the Recommend button below if you found this article interesting or helpful, so that others might be more likely to find it.

Please check out Qlockwork Automated Time Tracking for Outlook and Windows to explore image metadata, and you’re very welcome to follow @qlockwork on Twitter.

--

--

SciFi author interested in tech, engineering, science, art, SF, economics, psychology, startups. Chaotic evil.