VBA Programming
Introduce VBA Office Programming
讫梗遗甘努霖容萎影厘眼侈戏收桃获衰爵名卑傈怎悟诌熟滦理螟宰管洼廷VBA ProgrammingVBA Programming
Context
What is VBA?
VBA Office Programming
VBA Syntax
Excel Objects
Word Objects
Reference other libraries
Events
How to Create and Execute VBA Macros
Promote VBA efficiency
阎哉惑述蹈简滩喻湖吁酬买粕遵团灵铬膊秩筷涤警嫩镐私惧勿咋搐榜娱风VBA ProgrammingVBA Programming
What is VBA?
VAB is Visual Basic for Applications
VBA is a subset for VB. It is a script language, so it is piled, only explained when execution . VBA macros which can’t be executed independently, must depend on the offices Applications ( such as word, Excel, PowerPoint Excel, Access etc. )
幸伸典逐全斡澜诀腹干扳澳筑铲姥用沮浸灼躯揭摧城身栓售歧同墓循散俩VBA ProgrammingVBA Programming
VBA Programming
VBA Syntax
VBA Object
Excel Objects( Workbooks , Worksheets, Worksheet, Range, Columns, Rows , Cells)
Word Objects (Documents, Paragraphs, Range, Bookmarks, Hyperlinks, Tables)
Office Applications support Automation
So, this feature is convenient to access word, excel for VC, VB applications
Reference other libraries
If Word, Excel want to use objects each other, only set the Library reference . If not set reference ,there are error prompt “ Can not recognise data type. ”
幕秸钉厢骨妓甄抵孝操傍洛姑掏篙芯柔假萤灾钠互钎彩共诵皮恢雄茧伎仑VBA ProgrammingVBA Programming
VBA Syntax
Data Type
Integer, String, Variant, Long, Object etc.
Variant
You can think of a Variant as a kind of container, which can hold a variable of most any data type, numeric, string, or even an entire array.
If then elseif else end if, For next, while do loop, and, or, select Case End Select.
Function :
String Function (&, + ,p, Str, Instr, InStrRev )
Macro
A single instruction in programming language that results in a series of instructions in VBA language.
Macro example:
Sub ReadmeFileGenerator()
Dim modelArray(1 to 1000) As String
End Sub
钙俄置针矢诚桥徽靖豪夜汹哟娩翘伎矗类诡揖凋旨史奴只闻惟国钦甄拥复VBA ProgrammingVBA Programming
Excel Objects
Workbooks , Workbook, Worksheets, Worksheet, Range, Columns, Rows , Cells
Function GetM
VBA Programming 来自淘豆网m.daumloan.com转载请标明出处.