View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Macro and range names

There are 2 different kinds of named ranges; global and sheet specific. If
the named range is sheet specific then you need to have the code as you have
written it. If the named range is global then you can get away with just

If Range("valid").value < 0 Then

That being said I would stick with the code that you have as it should work
in both circumstances.

When in doubt being more specific with your references will always work out
for you.
--
HTH...

Jim Thomlinson


"Brad" wrote:

My question is this

Using the VBE I have rename sheetxx to shtInpinfo - Do I need the all of the
following code to use the range name "valid"?

If shtInpInfo.Range("valid").value < 0 Then
shtInput.[button 17].Visible = False
Beep
End If