Aicloud E-Learning

Guided Notes

Introduction to VBA

What VBA automates, and your first macro.

VBA (Visual Basic for Applications) is the scripting language built into Excel (and other Office apps) for automating repetitive tasks — anything you can do by clicking, VBA can usually do programmatically.

A macro is just a VBA `Sub` procedure: `Sub SayHello()` ... `End Sub`. You can run it directly from the VBA editor, or bind it to a button on a worksheet.

VBA scripts commonly work with Range objects to read and write cell values: `Range("A1").Value = "Hello"` sets cell A1's content directly, the same result as typing it in by hand.