Chapter 12. Built-in Functions and Statements
VBA has a large number of built-in functions and statements. For possible reference, Table 12-1 shows the VBA functions, and Table 12-2 shows the statements. We will take a look at a few of the more commonly used functions and statements in this chapter and the next.
Abs | CreateObject | Error | InputB | Len | PPmt | StrComp |
Array | CSng | Exp | InputBox | LenB | PV | StrConv |
Asc | CStr | FileAttr | InStr | LoadPicture | QBColor | String |
AscB | CurDir | FileDateTime | InStrB | Loc | Rate | Switch |
AscW | Cvar | FileLen | Int | LOF | RGB | SYD |
Atn | CVDate | Fix | Ipmt | Log | Right | Tab |
CBool | CVErr | Format | IRR | Ltrim | RightB | Tan |
CByte | Date | FreeFile | IsArray | Mid | Rnd | Time |
CCur | DateAdd | FV | IsDate | MidB | RTrim | Timer |
CDate | DateDiff | GetAllSettings | IsEmpty | Minute | Second | TimeSerial |
CDbl | DatePart | GetAttr | IsError | MIRR | Seek | TimeValue |
CDec | DateSerial | GetAutoServerSettings | IsMissing | Month | Sgn | Trim |
Choose | DateValue | GetObject | IsNull | MsgBox | Shell | TypeName |
Chr | Day | GetSetting | IsNumeric | Now | Sin | UBound |
ChrB | DDB | Hex | IsObject | Nper | SLN | UCase |
ChrW | Dir | Hour | Lbound | NPV | Space | Val |
CInt | DoEvents | Iif | Lcase | Oct | Spc | VarType |
CLng | Environ | IMEStatus | Left | Partition | Sqr | Weekday |
Command | EOF | Input | LeftB | Pmt | Str | Year |
Cos |
AppActivate | DefDec | Error | Kill | Open | Randomize | Set |
Beep | DefInt | Event | Let | Option Base | ReDim | SetAttr |
Call | DefLng | Exit | Line Input # | Option Compare | Rem | Static |
ChDir | DefObj | FileCopy | Load | Option Explicit | Reset | Stop |
ChDrive | DefSng | For Each...Next | Lock | Option Private | Resume | Sub |
Close | DefStr | For...Next | LSet | Print # | Return | Time |
Const | DefVar | Function | Mid | Private | RmDir | Type |
Date | DeleteSetting | Get | MidB | Property Get | RSet | Unload |
Declare | Dim | GoSub...Return | MkDir | Property Let | SavePicture ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access