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-Reference-Common-Objects.zip

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.

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!

1,683 comments

Your email address will not be published. Required fields are marked *

  • The object Hierarchy explanation really helped me understand. The macro I was currently working on was really giving problem. But the Hierarchy concept really helped and I got the bug fixed.

  • Thanks Jon. ths is a nice introductory video. Right now I’m simply looking to automate Copying a range of values (held in a column) and pasting them onto the end of another Column and then repeating the action accross a specified number of columns in a workbook.

  • I use Excel to calculate the allocation of various types of common areas to basic measurements of spaces. I then prepare small tables of four cells for each space plus summary tables. I then copy and special paste them to Autocad. That way I avoid transcription errors and get dynamic updates.

    What can happen, though, is that when I do make a change, some tables update, but others do not. To detect the tables that do not update, I use background color for the legend of each cell and change it every time I change the calculation. I manually change all the tables every time.

    It works, but if I could automate this process, I would be even happier.

  • I have X value in sheet1. Need to check X value in sheet2. If found, it should pick up the data (complete Rows & Cols) till it founds blank, from sheet2 and paste in sheet3. Can you please advice simple, quick macro for this.

  • I need to copy a range of numbers to blank rows below the last row of the range I am copying. The number of rows may change. The number of columns do not. I would like to paste the copy below the original range with a blank line in between them. There are totals I would like to copy for each column except the first two.

    I did macros years ago, but got away from them when it went to VBA. How do I define the start of the range to copy from (top left to bottom right), then define the top left of the target? Do you have a sample I can alter? The format is below. Thanks for your help, Hugh

    11-Jul 100 20 120 10 15 5 2 65
    11-Jul 100 20 120 10 15 5 2 65
    11-Jul 100 20 120 10 15 5 2 65
    11-Jul 100 20 120 10 15 5 2 65
    700 140 840 70 105 35 14 455

  • Hello,
    This is a great video.
    I am very new to VBA and found other courses intimidating.
    Your training really works for me and as an assistant accountant I would like to automate many projects like product mix reports, budgets, forecasts, auditing files etc.
    Looking forward to more lessons!

    • Hi Marlena, Thanks so much for the nice feedback. I’m happy to hear you are enjoying the training. 🙂

  • Your videos are what I am looking for. I am now better off than before when it comes to excel. Also I want the Tab Hound but its not for free.

  • Hi Jon

    Many thanks for the Video #1. It has been very useful.

    Only one question: in order to write the VBA codes, do I need to learn how to write SQL?

    Thank you.

  • Hi i want to automate refresh the data present in Power querry with out opening the excel. Here I am lading the data from Web server.

  • Your manner of training is very good; Tone of voice is excellent and content is great. You explain the building blocks very well. Am starting to feel comfortable with VB so far. Thank you.

  • Really comforting. I understood and therefore enjoyed it. Looked at it at lunch time and it did make me hungry especially for a banana – ha ha ha.

    Looking forward to the next video.

    Thanks Aggie

  • Hi,

    When does your VBA course will be open? It’s kinda weird to realize how to get in into the course. It always “closed course” like how it has been sold out or something. How can I do to apply on the course?

  • Thank you very much, although i not going to use this skill now, but being pro in excel is my dream. i believe this will help in my career

  • Thank you so much, i learnt excel so long but no one proficient in our area, i think i will be the one excellent in excel in our area. thank you so much.

  • Running a small general store also besides a full time job. Want to automate my small business.

  • thank u VBA is really exciting
    my question is: can i write a code for calculation & formulas &how far can it take me ?

  • Great video – Thank you so much.
    What I would like to know how to automate is how can I consolidate several worksheets from workbooks I receive from different people into one worksheet? The workbooks/worksheet all have the same format, the content is different.
    Thank you.

  • Hi. Jon

    I am pleased watching your a great videos
    Can not wait to watch more….
    Thanks for sharing your knowledge and experience.
    Wishing you all the best.

  • Great video, thanks for sharing. I’ve been building a spreadsheet for almost a year, adding new features and information. I quickly realised the power VBA could bring to it. I’ve created a few very useful macros, but it has taken a lot of trial and error along with a lot of frustrating web searches. These videos will certainly speed up my learning, enabling me to further develop my project as well as tidy up my existing code. Thanks for sharing!

  • I really liked it and it is vey well structured making it easy to understand Objects, properties, action … . Thank a lot.

    What makes me look for a vba is I would like to copy cell values to blank cells above. And this has to be repeated several times until end of file.

  • Hi,

    I am new subscriber. Great video!

    I would like to know more about how can I use a user form to store data continuously in a worksheet, then create reports from it… the reports might require formulas so I can create rates from the inputs of the user…

    Maybe it comes in a later video set? Do you offer training for this purpose?

  • Hi, I’m a new subscriber here. Just watched VBA#1. VEry helpful. I’m using the videos to give me a good intro into VBA and what it can do. Thank you. Good job.
    Jerzy

  • I thought this was helpful. I’ve been stumbling through trying to automate by Google and I have found some useful macros. Although, it’s frustrating because more often than not, I can’t find anything that perfectly matches what I need.

    What I need now is I’m trying to find a macro that auto-sizes my columns after running a filter, but that does not also re-size the header rows 1-3. I have basic information names and addresses and other fields that need to be resized after the filter so that I can see as much of the data on the screen without having to scroll right.

  • Right now I am trying to improve my skills. I need to learn the steps and their order in the process better. I find your style easy to follow. Thanks!

  • Two years ago,I knew I would have to find a new way to make a living. I enrolled in classes at my local Goodwill
    Lab. There I learned how to turn on a computer, having never used one. I applied myself totally In my lessons for 6 mo. At the end of that time I completed the following:

    Windows 10 Basics,Word,Access,PowerPoint,entreprenuership,and then I started a class called Excel. I was hooked.
    The more I learned the more intriguing it was. Can’t get ! A system that does it all.
    Thanks to YouTube and Goodwill and you Jon.

  • Thanks for this training Jon!
    I want to improve my skills – till now I was only copying code from the Internet and would like to be more self-sufficient.
    Looking forward for next parts.

  • Great Intro to VBA. My goal is to increase skills in Excel to help me to add value in current position and help me to get advance in my accounting career. I should like to automate a weekly and monthly production report.

    Thank you!!

    Shanta’ Stewart

  • Great start. I need to count certain action within a date range (federal fiscal year)from multiple sheets. I would think that a pivot table might work but I’m not sure if a macro would be better. How does one determine that?