View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Checking if a cell has a range name


Hi,

Try this. You don't need the message boxes, they're to illustrate it works

On Error Resume Next
dummy = ActiveCell.Name.Name
If Len(dummy) = 0 Then
MsgBox "activecell is not in named range"
Else
MsgBox ActiveCell.Name.Name
End If

Mike

"James Price at Premier" wrote:

I have a worksheet which has a number of Range names. Each named range
relates to one cell only. There will be no instances of more than one range
name in a cell. Can I use VBA to check if the Active Cell has a range name
in it.

Many thanks

James