Passing Names to Macro's

  • Thread starter Thread starter Randy Numbers
  • Start date Start date
R

Randy Numbers

How can I have a macro recognize a named range? E.g. ADDON=5 is defined
and named in a cell, and I want to reference it in the macro.

Thanks.../RN
 
RN

Like this

Sub referToRange()
Dim sRangeName As String
sRangeName = ThisWorkbook.Names("ADDON").Value
MsgBox "ADDON Value" & sRangeName
End Sub


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
Frank,

Thanks again for all your help. Here is what I'm trying to do:

If MsgBox Range("addon_flag").Value _
Then
DIV = 100
resid = 10
End If

In other words, addon_flag is either 1 or 0; if 1 I want to do some stuff,
otherwise not... thanks../RN
 
Back
Top