1.変数の型
表1:VBAで使う変数の型一覧
変数の型 | 格納するデータ |
Boolean | TrueまたはFalse |
Byte | 0~255までの整数 |
Integer | -32,768~32,767の整数 |
Long | -2,147,483,648~2,147,483,647の整数 |
Currency | -922,337,203,685,477.5808~922,337,203,685,477.5807 |
Single | -3.4×10^38~-1.4×10^-45、1.4×10^-45~1.8×10^38 |
Double | -1.8×10^308~-4.0×10^-324、4.9×10^-324~1.8×10^308 |
Date | 西暦100年1月1日~9999年12月31日、時刻0:00:00 ~ 23:59:59 |
String | 任意の長さの文字列 |
Object | オブジェクト |
Variant | すべてのデータ |
2. 演算子
if else
for
while
goto
4. 関数
4.1 変数
Asc
AscB
CDate
CVDate
Filter
GetAllSettings
IsEmpty
TypeName
4.2 配列
IsArray
Join
LBound
Array
UBound
4.3 進数
Hex
Oct
4.4 日時に関する関数
Date
DateAdd
DateDiff
DatePart
DateSerial
DateValue
Day
FormatDateTime
Hour
IsDate
Minute
Month
MonthName
Now
Second
Time
Timer
TimeSerial
TimeValue
WeekDay
WeekdayName
Year
4.5 数学的な関数
Exp
Abs
Sqr
Rnd
4.6 三角関数
Atn
Cos
Tan
4.7 数値
Int
Partition
Round
4.8 入出力
Input
InputB
InputBox
MsgBox
Tab
4.9 引数
CBool
CByte
CCur
CDbl
Choose
CInt
CLng
CSng
CStr
CVar
Fix
Format
GetSetting
IsMissing
IsNull
IsNumeric
IsObject
Sgn
Switch
4.11 ドライブパス
CurDir
4.12 エラー
CVErr
Error
IsError
4.13 オブジェクト
CallByName
CreateObject
GetObject
4.14 オペレーティングシステム
DoEvents
EnViron
4.15 ファイル・フォルダ
Dir
EOF
FileAttr
FileDateTime
FileLen
FreeFile
GetAttr
Loc
LOF
MacID
Seek
4.16 文字処理系関数
AscW
Chr、ChrB、ChrW
FormatCurrency
FormatNumber
FormatPercent
InStr
InstrB
InStrRev
LCase
Left
LeftB
Len
LenB
Log
Mid
MidB
Replace
Right
RightB
RTrim
Space
Spc
Split
Str
StrComp
StrConv
String
StrReverse
Trim
UCase
Val
VarType
4.17 画像処理系関数
LoadPicture
4.18 色
QBColor
RGB