Tutorial: https://www.tutorialspoint.com/vba/vba_text_files.htm
MSDN: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/worksheet-querytables-property-excel
Module
Procedure
The two main types of Procedures are Sub and Function.
function
sub-rpocedures
定義變量:
Dim <<variable_name>> As <<variable_type>>
定義常量:
Const <<constant_name>> As <<constant_type>> = <<constant_value>>
numeric變量類型:Byte Integer Long Single Double Currency Decimal
non-numeric變量:String Date Boolean Object Variant
msg中的換行:Chr(10)
QueryTable : Worksheet表瓣履,數(shù)據(jù)源來自于Worksheet之外
VBA Trim()
Sub Macro1()
Dim WrdArray() As String
Dim text_string As String
text_string = "2015/2/12"
WrdArray() = Split(text_string, "/")
For i = LBound(WrdArray) To UBound(WrdArray)
strg = strg & vbNewLine & "Part No. " & i & " - " & WrdArray(i)
Next i
MsgBox strg
End Sub