Complete List of Visual Basic Commands

Only available on StudyMode
  • Download(s): 145
  • Published: May 14, 2012
Read full document
Text Preview
Aaron Wirth

Complete List Of Visual Basic Commands
Note: To go to pages use the Page function in the View – Go To menu, shortcut: Shift + Ctrl + N. Press Ctrl + Home to return to Table of Contents.

Table of Contents Strings (P3)
Left and Right functions (P3) LCase and UCase functions (P4) FormatDateTime (P6) Len Function (P7) InstrRev (P9) Replace Function (P10) Base 0 & 1 (P3) Formatting (P4) Mid function (P7) InStr (P8) Asc Function (P9) StrComp (P10) Trim, LTrim, and RTrim functions (P3) FormatCurrency, Percent & Number (P5) Chr Function (P7) String function (P9) Space Function (P9) StrConv function (P10)

Math (P12)
Val Function (P12) Rnd & Randomize (P12) Abs function (P13) Round (P12) Int and Fix functions (P12) Sgn (P13) Sin, Cos, Tan, Log, Atn & Exp Functions (P13) Other Math Functions (P14)

Logic (P15)
Mod Operator (P15) Xor Operator (P17) Is Operator (P18) And (P15) If Not (P17) Or Operator (P16) Like Operator (P17)

Arrays (P19)
Erase Statement (P19) Array Function (P20) Dim (P19) ReDim (P19)

Files/Folders (P21)
Dir (P21)

CurDir (22) Kill Function (P23) FileLen (P23) GetAttr (P24) Open Function (P26) Line Input (P27) Lof Function (P28)

ChDir (P22) ChDrive (P22) MkDir (P22) RmDir Function (P23) FileDateTime (P23) FileCopy (P24) Cut, Copy & Pasting Text (P24) SetAttr (P25) FreeFile function (P25) Close Statement (P27) EOF Function (P27) Print Function (P28)

Error Handling (P29)
On Error Statement (P29) Error Function (P30) Resume, Resume Next, Resume Line (P29)

Declarations (P31)
Function Procedures (P31) CallByName (P33) Option Private (P34) Type…End Type (P35) Let Statement (P36) DefType (P39) Const (P32) Call Statement (P33) Option Explicit (P34) Option Compare (P34) GetObject (P35) CreateObject (P36) TypeName (P37) VarType (P38)

Date/Time (P41)
Date (P41) Timer (P41) DateSerial (P44) Month (P45) Day (P46) TimeSerial (P47) Time (P41) Now (P41) DateAdd (P42) DateDiff (P42) DateValue (P44) Year (P45) MonthName (P45) WeekDayName (P45) Hour (P46) Minute (P47) TimeValue (P48) WeekDay (P48)

1

Aaron Wirth

Miscellaneous (P50)
MsgBox (P50) QBColor (P53) Load (P54) LoadPicture (P57) Shell (P51) RGB (P52) Beep (P53) InputBox (P53) UnLoad (P54) SendKeys (P55) AppActivate (P57)

Values (P58)
IsNull (P58) IsEmpty (P58) IsNumeric (P58)

Loops and Conditional (P59)
If...Then...Else (P59) End Statements (P59) Stop Statement (P60) Switch (P61) GoTo Statement (P61) On...GoSub, On...GoTo Statements (P62) GoSub...Return Statement (P62) With Statement (P63) For...Next Statement (P63) While...Wend Statement (P64) Do...Loop Statement (P65) IIf Statement (P65) For Each...Next Statement (P66) Select Case Statement (P67)

2

Aaron Wirth

Strings
Left and Right functions
Returns a Variant (String) containing a specified number of characters from the right side of a string.

Syntax
Left(string, length) Right(string, length) Example: Dim AnyString, MyStr AnyString = "Hello World" ' Define string. MyStr = Right(AnyString, 1) ' Returns "d". MyStr = Right(AnyString, 6) ' Returns " World". MyStr = Right(AnyString, 20) ' Returns "Hello World". Part string length Description Required. String expression from which the rightmost characters are returned. If string contains Null, Null is returned. Required; Variant (Long). Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in string, the entire string is returned.

Base 0 & 1
Option Base {0 | 1} Because the default base is 0, the Option Base statement is never required. If used, the statement must appear in a module before any procedures. Option Base can appear only once in a module and must precede array declarations that include dimensions. The Option Base statement only affects the lower bound of arrays in the module where the statement is located. Example: Dim iNumber(15 To 114) As Integer

Trim, LTrim, and RTrim...
tracking img