View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default How to Bind VBA Variable to Range().Value2 Property

create the property, then use it in your code exactly as if it were a
'normal' variable

eg

x= myvalue * 2



"Patrick Molloy" wrote:

Option Explicit

Public Property Get MyValue() As Double
MyValue = Range("Cell.Reference").Value2
End Property


"MachAngle" wrote:

I want to use Excel VBA variables in modules and classes as "shorthand" for
the Range().Value2 property. I tried using declarations like:

Dim Variable As Double
Set Variable = Range("Cell Reference").Value2

Is there some way to use data binding in VBA to "link" a variable to a Named
cell property?