User-Defined Data Types : Type « Data Type « VBA / Excel / Access / Word






User-Defined Data Types

 
Type Ledger
     Number As Integer
     Description As String
     Debit As Currency
     Credit As Currency
     Balance As Currency
End Type
Sub typeDemo()
    Dim ledgerRow As Ledger
    ledgerRow.Number = 1001
    ledgerRow.Description = "Rent"
    ledgerRow.Debit = 750
    ledgerRow.Balance = ledgerRow.Balance - ledgerRow.Debit
End Sub

 








Related examples in the same category

1.An Example of Using a Type Structure
2.Save type info to form
3.Create a new data type