Skip to content

copatche/excel_vba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Excel VBA Hello World Program

A simple Hello World program written in VBA (Visual Basic for Applications) for Microsoft Excel.

Contents

  • HelloWorld.bas - VBA module containing three Hello World examples

Macros Included

1. HelloWorld()

Displays a message box with "Hello World!" message.

2. HelloWorldToCell()

Writes "Hello World!" to cell A1 with bold formatting and increased font size.

3. HelloWorldDebug()

Prints "Hello World!" to the VBA Immediate Window (useful for debugging).

How to Use

Method 1: Import the .bas file

  1. Open Microsoft Excel
  2. Press Alt + F11 to open the VBA Editor
  3. Go to File > Import File...
  4. Select HelloWorld.bas
  5. Press F5 or go to Run > Run Sub/UserForm to execute the macro

Method 2: Copy and paste the code

  1. Open Microsoft Excel
  2. Press Alt + F11 to open the VBA Editor
  3. Go to Insert > Module
  4. Copy the code from HelloWorld.bas and paste it into the module
  5. Press F5 to run the macro

Method 3: Run from Excel

  1. After importing/adding the code, return to Excel
  2. Press Alt + F8 to open the Macro dialog
  3. Select HelloWorld (or any other macro)
  4. Click Run

Requirements

  • Microsoft Excel (any version that supports VBA)
  • Macros must be enabled in Excel

Security Note

To enable macros in Excel:

  1. Go to File > Options > Trust Center > Trust Center Settings
  2. Click on Macro Settings
  3. Select Enable all macros (or Disable all macros with notification)

License

This is a simple educational example and is free to use.

About

excel vba programming basic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages