VBA Training Series – How to Write Your First Macro (Part 1 of 3)

Macros & VBA Training Series Part 1:

Writing Your First Macro & The Excel Object Model

Double-click video to view in Full Screen HD.

Download the file used in this video:

My First Macro.xslm (93.0 KB)

Macros & VBA Training Series

Enroll for FREE

The video above is the first in a 3-part training series. Can I send you the next two videos?

Please click the link below to enroll in the free training. I will send you video #2 in just a few days.

Video 1

Intro to VBA:
Writing Your First Macro

Video 2

Automating Tasks:
The Summary Report

Video 3

The Exports Sheets App

Please click the big green button above to register for the free training series.

Jon Acampora Circle MVP Profile 2019

About Me

Welcome to Excel Campus!  I am excited you are here!

My name is Jon Acampora and my goal is to help you learn Excel to save time with your job and advance in your career.  I've been an avid Excel user and VBA developer for 10+ years.  I am also a Microsoft MVP.  When I'm not looking at spreadsheets, I get outdoors and surf. 🙂

What Process Do You Want To Automate in Excel?

Please leave a comment below with your answer, and any questions.  Thanks!

  • Importing multiple csv files then using the data in these files to complete multiple actions ~ send email, create entry in log, etc.

  • Generate bar codes for employees and register entry and exit time when the bar code is scanned. Create weekly and monthly reports.

  • I need to automate a check list including Yes/No/NA. Also totaling points and deciding a range category or grade.

  • Hiiii
    Please send me the other link videos of this series(video2,video3) soon as that i can study and prepare for my upcomingg interviews.

  • Hello Jon,

    How can I see the next two videos? Very easy to follow along and short videos help be take notes and retain information. Thank you.

  • I really want to improve my skill in excel if function variation.
    If you coud help me send the material guidance please

  • I want to take my “job master” from a one workbook/one job to a one workbook/multiple jobs workbook.

  • I enjoyed your VBA Macro tutorial, I am taking a class in code and they are flying through with little time to grasp the content thank you for providing these videos.

  • Hi Jon,

    I need to automate a process for averaging 10 sequential datapoints into 1 datapoint i.e. 10 Hz data into 1 s – I have ~30 worksheets and each worksheet contains 25000+rows with 4 columns of variables. I don’t want to create a 10 second rolling average, but rather an average of row 1-10, 11-20, 21-30 etc etc I’ve just watched your brilliant videos on VBA and writing my first code (I didn’t know what a macro was until then) and have tried to record a macro for this but I am now stuck! If you have any suggestions that would be amazing, thank you.
    (This is the code I recorded for the first 2 cells that I performed the process in):

    ActiveCell.FormulaR1C1 = “=AVERAGE(RC[-6]:R[10]C[-6])”
    ActiveCell.FormulaR1C1 = “=AVERAGE(R[10]C[-6]:R[20]C[-6])”

  • Mr Jon
    thank you for your excelent presentation. I now understand the basics of VBA. Can you please allow me to continue with the 2nd video.

  • I want to create an approval workflow macro without using PowerApps please. Need this ASAP to create a workaround system crash issue. Business must go on.

  • I am trying to automate a comparison of GL accounts from two separate systems so that I can identify accounts not being used in either system and close them.

  • Hi Jon,
    You are so amazing. You’ve made the difficult tasks so easy. Can you please send me the next two videos? I can’t wait to watch them.

    Thank you very much.

  • I need to copy and paste a brown cell filler every 7th cell in a column of 6000 rows. The range contains a blue filler in every 50th cell. The range of cells is in descending order, i.e. 6000, 5999 5998 etc.

    Here is a snapshot of what I mean

    6000 Blue
    5999 Brown
    5992 Brown
    5985 Brown

  • Thanks a lot for your free training. It is very clear and straight to the point.

    Following is one of the task which I wish to automate.

    The inventory status of Stock item in a workbook.
    1) My workbook contains the inventory of many items.
    2) Each worksheet document 1 type of item
    3) The inventory of “in” and “out” of each unit of the item is documented. 1 row = 1 unit. When the unit it taken, user record the date of when the unit is removed from inventory in the date column of the same row.
    4) Need to replenish the item when the remaining unit of the item fall below a certain critical number. Each item has its own critical number.

    I hope to automate the counting of the stock from each worksheet, may be summarized the stock level (number of unit remains for each item) in 1 sheet and highlight to trigger re-ordering for item which has remaining unit falls below the critical number.

  • I like your videos very much. I’m on a deadline and I need some help. I am using the correl function on a table of data that is a list of test and the data for each test arranged by columns. I want to correlate test 1 to every other test, Test 2 will be correlated to all tests except 1, Test 3 will correlate to all tests except 1 and 2, etc.

    The output should be something like this:

    Test # Test # Correlation
    1 2 0.95
    1 3 0.98
    1 4 0.13
    2 3 0.91
    2 4 0.25
    3 4 0.75

    Let Test 1 be in Column A, Test 2 is in Column B Test 3 in C and Test 4 in D.

    I appreciate any guidance you can give me.


  • Thanks for the great videos. I am completely new to VBA so all introduction type videos are great. I work a lot with pivot tables and charts so automating pivot table refreshes. Also moving information from Word Forms to Excel back to Word if that is possible with VBA. Or moving information from an excel input form to calculations and out to reports in excel or word.

  • Hi Jon,

    Thank you so much for sharing this video! I always wanna learn more about excel. I plan to watch one of your videos everyday to develop my excel skill.

    Best Wishes

  • Hi Jon,

    Great tutorial. I like to see how you can use VBA to invoke actions like running queries and combining queries.

  • Want to make an excel based tool for Uncertainty Management in my PhD. It needs some Buttons, Formulas, Macros and Visuals.

  • Thank you for this Jon! Currently I would like to automate merging sheets or ranges in one workbook onto a consolidated sheet on the same workbook. Merging sheets from different workbooks (or entire workbooks) into one consolidated workbook. The goal would be to create a pivot table from the compiled data.

  • >