Computer Tutoring Logo
Est. 2002
Menu Button

Copy and Paste a Macro

How to copy and paste macro code in Excel?

This video will show you how to copy and paste the macro vba text into a new worksheet.

  1. First open the text file that you want to use, you can use the sample at the bottom of the page.
  2. Highlight and copy the text.
  3. Switch to Excel and click on Visual Basic button which is on the left side of the Devloper tab.
    (If not available you can display it through the options).
  4. In the VBA windows ensure that you see the project explorer.
  5. Double click on ThisWorkbook in the project explorer on the left to open a VBA window.
  6. Paste the code into the VBA window.
  7. Add a few sheets to the spreadsheet and enter 10 in cell A1 on a few of the sheets.
  8. Then run the macro.
If you want to follow along you can download the exercise file.