Thread: Class Modules
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Class Modules

Lets and Gets and just the write/read specific properties. If you just
declare a public variable, that effectively becomes a read/write property.
In summary, yes you can.

Here's a very simple Class

Public myVar

Public Function myMethod() As Long
myMethod = myVar * 5
End Function


and this is the class invoked in a normal module

Sub test()
Dim myClass As Class1

Set myClass = New Class1
With myClass
.myVar = 17
MsgBox .myMethod()
End With

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ibeetb" wrote in message
...
Can you create a Class Module using VBA without using the Property Lets

and
Gets???
Can you instead just Publicly declare the Class Module?
If so....does anyone have a full example from the creation of the class
module through creation of the code for the Regular code module???
I would appreciate it

Than k you