How to import and run Excel Macros in .bas format

This guides describes how to import and run Excel Macros in .bas format. Macros importing will work with open Workbook.
1. Please press "ALT+F11" key combination. Microsoft Visual Basic for Applications window will appear.
2. Select from "File" menu - "Import File... (CTRL+M)".

Import_Module_01_Free-Excel-VBA.Blogspot.com

3. Select TestModule.bas from your hard drive and press "Open" button. New "Module1" will be shown in VBAProject window

Import_Module_02_View_Code_F7_Key_Free-Excel-VBA.Blogspot.com


4. To View Macros code right click and select "View Code". "TestModule" VBA macros code will be shown

Import_Module_03_View_Code_Window_Free-Excel-VBA.Blogspot.com


5. Please return to Sheet1 window, press "ALT+F8", select "TestModule" in "Macro" window and press "Run" button.

ALT_F8_Eng_Free-Excel-VBA.Blogspot.com


Your VBA macros in .bas format will be executed. These are results of  TestModule.bas macros running. You can download Book1 XLS file with TestModule.

Import_Module_04_Macros_Result_Free-Excel-VBA.Blogspot.com


Video guide: