什么是VBA
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。主要能用来扩展Windows的应用程序功能,特别是Microsoft Office软件。它也可说是一种应用程式视觉化的 Basic 脚本。
录制宏
- 相对引用
- 绝对引用
第一个VBA程序
VBE
- Visual Basic Editor 可视化基本编辑器(快捷键:Alt+F11)
- VBE窗口
- Sub过程
Sub case1()
Msgbox "hello"
End Sub