Run VBA online: test Excel macros in your browser

Write an Excel macro and run it right here, on a sales list, a staff list or an empty sheet. You see the sheet afterwards, message boxes and the Immediate window, and you can step through the macro line by line. You do not need Excel for this.

Sheet "Sales" with date, region, rep, product, quantity and price of an office supplies dealer.

How to use the editor

  • Run (F5 or Ctrl+Enter) starts the macro your cursor is in, just like the VBA editor in Excel. The sheet after the run appears below, with changed cells highlighted.
  • Step through (F8) highlights the line that runs next in yellow, with the variables in the Locals window and the sheet as it is at that step. How to find bugs this way is covered in Debugging.
  • MsgBox shows up as a message box below the sheet, Debug.Print in the Immediate window. An InputBox returns empty text here, since nobody can type into it.
  • Every run starts again from the sample data. Your code is kept in this browser; nothing is stored on the server.

What the editor can and cannot do

There is no Excel behind the editor but a re-creation of the VBA language with a worksheet. It knows variables and data types, loops, conditions, error handling, your own procedures and functions, arrays, Collection and Dictionary, Range and Cells with values, formulas and formats, Offset, End, Find, Sort, Copy, worksheets and many worksheet functions through WorksheetFunction. Error messages use the same wording as the VBA editor in English Excel.

Things outside a workbook are not included: opening or saving files, other programs such as Outlook, UserForms, charts and PivotTables. The editor reports those commands as not available in the exercises.

Learn instead of just trying

In the VBA course you solve tasks with the same editor. There the server also checks your macro against other data you do not see. That catches a loop that stops at a fixed row, or a result typed in instead of calculated. New tasks at the push of a button are in the random VBA exercises.

FAQ

Is this real VBA?

The language is the same; it is run by our own program on the server. For the code you write in the course and the editor, it behaves like Excel. What you learn here works the same way in Excel's VBA editor.

Can I copy my macro into Excel?

Yes. Copy the code, open the VBA editor in Excel with Alt+F11, add a module with Insert > Module and paste the code there. Save the file as an Excel Macro-Enabled Workbook (.xlsm). Why Excel sometimes blocks macros is explained in Enable macros.

Can a macro do any harm here?

No. The macro only sees the sample data on this page, no files and nothing on your computer. The server stops endless loops after a short time.

Does the editor work on a phone?

Yes, it runs in any current browser, including tablets and phones. A keyboard is more comfortable for writing longer macros.

Write to us

Choose language

Select your preferred language