Creating Custom Objects : Class « Data Type Functions « VBA / Excel / Access / Word

VBA / Excel / Access / Word
1. Access
2. Application
3. Data Type
4. Data Type Functions
5. Date Functions
6. Excel
7. File Path
8. Forms
9. Language Basics
10. Math Functions
11. Outlook
12. PowerPoint
13. String Functions
14. Windows API
15. Word
16. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VBA / Excel / Access / Word » Data Type Functions » Class 
Creating Custom Objects
 

Option Explicit
Private m_LastName As String
Private m_FirstName As String
Private m_Salary As Currency
Private m_Id As String
Property Get Id() As String
    Id = m_Id
End Property

Property Get LastName() As String
    LastName = m_LastName
End Property

Property Get FirstName() As String
    FirstName = m_FirstName
End Property

Property Get Salary() As Currency
    Salary = m_Salary
End Property
Property Let Id(ref As String)
    m_Id = ref
End Property

Property Let LastName(As String)
    m_LastName = L
End Property

Property Let FirstName(As String)
    m_FirstName = F
End Property

Property Let Salary(ByVal dollar As Currency)
    m_Salary = dollar
End Property

Public Function CalcNewSalary(choice As Integer, curSalary As Currency, _
    amount As LongAs Currency
    Select Case choice
        Case ' by percent
            CalcNewSalary = curSalary + ((curSalary * amount100)
        Case ' by amount
            CalcNewSalary = curSalary + amount
    End Select
End Function

 
Related examples in the same category
1. Creating and Using a Class Module
2. Class Module: FileInformation
3. Class Module: FullName
4. The SimpleLoan Class
5. Loan Object Implementation Details
6. Rectangle class
7. Creating the MyRectangle Class
8. Abstraction
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.