View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Wills Rob Wills is offline
external usenet poster
 
Posts: 18
Default Call the property of a class using a variable

I'm sure this is possible.

I have written a class module which contains a number of properties.

I wish to change the value of one of the properties, however I want to
dynamically identify the property that I'm changing

For example: if my class has integer properties of X and Y I wish to be able
to do somthing similar to below

========================================
Function Change_Value(strProperty as String, iValue as Integer)
Dim objClass As myClass

Set objClass = New myClass

objclass(strproperty) = iValue

End Function
=========================================

Thanks in Advance
Rob