X may be Null Simple conversion functions Null parameters: A Null string as input will give the result Null. ) Continue here at error On Error GoTo 0 Let VBA handle errors Optional Optional Optional Conditional statements While a= 0 CStr(#) = “23-10-03” Converts to regional date format CVar(X) = X As Variant. Test for error On Error GoTo fail Enable error handler. End Select On Error Resume Next Ignore error. End If Select Case zip Case 4000 type = a. Multiple statements ElseIf a=2 Then c=d / 2. All database fields are Variant String Variable length, max 2E9 characters String * 50 Fixed length, space filled Initial values String = “”, Boolean = False Number, date = 0 Database field = Null Object = Nothing Variant = Empty Dim c(5, 1 To 6) As t Same as c(0.5, 1.6) Dim d( ) As Single Dynamic array declaration ReDim d(5, 1 To 6) Statement Index range (re)defined, data lost ReDim Preserve d(5, 1 To 8) Last index range redefined, data preserved Erase d Releases memory for dynamic array Type Customer Simple modules only custID As Long custName As String * 50 custAddress As String End Type Dim custTable(20) As Customer Declarations i = i+2 ‘ Comment s = “long text A” & _ “long text B” ‘ Comment in last line only Set f = Forms(0) Store a reference Set f = New Form_frmG Create object, store ref Set f = Nothing Delete object if last ref Line continuation, comments, assignment If a=1 Then c=d+2 Single statement If a=1 Then c=d+2. Dec 1899, 0:00 Object Reference to any object Form Reference to any Form Variant Any of the types or Null, Empty, Nothing, Error - plus a type tag. 1.8E308, 14 digits Date Double, days since 30. Download VBA Cheat Sheet and more MS Microsoft Excel skills Cheat Sheet in PDF only on Docsity!Dim B, C As Byte B is Variant, C is 0.255 Boolean True ( 0), False (=0) Integer 16 bit, -32,786.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |