Method I have used in the past is putting all instance variables on a UDT. As long as you keep the UDT up to date you can copy a class' data with a single method/statement.
Given a "Person" class here's a simple example:
Private Type tPerson
ID As Long
FirstName As String
LastName As String
End Type
Private m_Person As tPerson
Public Sub InitPerson(ID As Long, FirstName As String, LastName As String)
m_Person.ID = ID
m_Person.FirstName = FirstName
m_Person.LastName = LastName
End Sub
Friend Sub SetData(PersonData As tPerson)
m_Person = PersonData
End Sub
Public Function GetClone() As Person
Dim p As New Person
p.SetData m_Person
Set GetClone = p
End Function
Public Property Get FirstName() As String
FirstName = m_Person.FirstName
End Property
To try the code:
Dim p As New Person
p.InitPerson 1, "MyName", "MyLastName"
Dim p2 As Person
Set p2 = p.GetClone
MsgBox p2.FirstName
If you maintain all instance varianbles inside the UDT instead of declaring them seperately you can have simple Clone method that needs very little maintenance.
Another advantage is you can put a UDT to a file handle for quick serialization to disk.
Public Sub Save(filePathName As String)
Dim f As Integer
f = FreeFile()
Open filePathName For Binary Access Write Lock Read Write As #f
Put #f, , m_Person
Close #f
End Sub
A poor men's serialization solution really :-)