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,671 comments

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

  • Hi Mr. Jon, how we can write macro to refresh all Pivot tables if we have more source data sheets and pivot tables in one workbook.

  • Although English is my second language, but I can understand your lesson easily.
    You have explained everything in details so I fully got it!
    Thank you very much, Jon!

  • I want to acquire some skills that help me to automate reading data files from analytical instruments and process the contents.

  • the process i am trying to automate in excel is , tracking time in a workshop environment so that multiple users can track there time in one place. The collected data can then be shared with the office personal who collects the time sheets and inputs the data to the proper job costing

  • Hi Jon, Thank you for these fantastic videos. Unfortunately I just can get the first one. Did not received any link for video 2 and 3

  • amazing explanation with brave visualization,, very clear and easy to understand ,, I have a question ,, what is the code to copy paste value cell to another cell base on other cell value,, lets say if A1=”close” then copy value cell B1 to cell C1 without any button press, thank you

  • Is it possible to develop a data entry program in Excel. I want to create a form to capture blood work results and store them into SQL server. Please advise. If you have any samples can you please show me?

  • This is a great start to learning.

    Need to clear contents of multiple columns or cells based on content of other cells. Will also need to delete rows based on cell content.

  • I have a live “database” file that is automatically being updated by our test machine as it completes testing. However, it can only populate one test per row, with “Material” as one of the columns. I want to have an excel file that I can open up that will automatically search for a specific material then take the test results for that material and put into sequential columns.

  • Jon, thanks for all the great resources you provide! I’m a small business owner and my product is heavily based around Excel. My automation goals would include providing a “watered-down” version of the template spreadsheet we use internally so that we can provide it to clients as a deliverable without making their heads spin. Essentially, to use VBA to copy and paste certain parts of the template w/ formulas included and certain parts as values only. Also, in general, to make data visualization improvements on the user end i.e. creation of a dashboard with picot tables, graphs, slicers, etc.

  • Looking for a VBA that will copy from various one excel sheets into 1 master excel sheet that keeps record off all the other sheets. Hoping you can help me out

  • Compare row by row the value in one column and highlight it if it appears in any of 4 adjacent columns

  • Hello Jon,

    I learned Macro’s using an existing raw data form. It was a parts list that I had to manipulate and set rows, columns, headers, spacing, etc. I was able to go in and read the VBA with not much difficulty and had to manipulate certain criteria so it would be in a presentable format since it was shared with a 3rd party vendor. The parts list was so big I had to use multiple macros to run it from start to finish. I am not sure how I can start and what level of macro knowledge I need to begin with. I definitely had fun creating macros and figuring out in VBA what criteria I needed to input to get the macro to run and support all the information required by the customer.

  • I want to create a Microsoft Word document based on data within an Excel spreadsheet.

    I have data in the spreadsheet corresponding to different people, with their name, address, phone number, and other details. I want to create a Word document that summarizes that data into a table where each cell in the table contains information about that person.

  • Great intro! Really liked your Object model description. Wish I had watched it prior to starting OOP years ago. I’m new to VBA and finding your video’s very helpful in gaining the knowledge and understanding I need for a project I’ve volunteerd for which is to help a non-profit artist coop automate their monthly sales reports for each artist.

    The data is stored in an excel worksheet that contains all previous months’ sales data downloaded from Square Retail Plus. On a seperate worksheet I have a dynamic function which references 3 fields, artist, year, month to create a report of the selected artists sales. I want to program a button to copy the report range into a new email message (MS Outlook Web preferred or Outlook Desktop) and display the draft message. The report formating should be as readable as it is in Excel not just a bunch of mushed together text.

    In addition I want the subject line and text preceeding the report to be composed of both static text as written in a couple of named ranges plus dynamic data such as the artist’s name, the month and year covered by the report and the date the report was generated.

    • Thank you, Michael! We appreciate your kind words and support. For copying the report into an email, consider using Power Automate. Power Automate is a low-code application by Microsoft that automates routine tasks and processes across multiple applications. The Power Automate Course is available for free for members of Elevate Excel. Here is a link to learn more about Elevate: https://www.excelcampus.com/elevate-excel-invite/