OOP in vba?

H

Harvey

Hi

I have to declare an object named LegalName that contains three public variable

Class LegalName
Dim Id as Intege
Dim Name as Strin
Dim CRef() as Strin


Can I do something like that in vba? thx
 
S

Steve Lang

Hi Harvey,

Try using a User Defined Type Variable:

At the module level define it:
Private Type udtCat

Color as string

Name as string

Lives as Integer

End Type



Then use it

Sub foo

Dim udtFluffy as udtCat

udtFluffy.Color = "Calico"

etc...

End Sub



HTH and have a great day!



Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top