View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_2_] Leo Heuser[_2_] is offline
external usenet poster
 
Posts: 111
Default If Range.Name question

Hi Otto

You must have Name twice. The first
Name returns the address of the cell, and
the second Name returns the name of
that address (if any).

Sub TestName()
If ActiveCell.Name.Name = "Hello" Then
MsgBox "Yes"
Else
MsgBox "No"
End If
End Sub

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Otto Moehrbach" skrev i en meddelelse
...
Excel XP & Win XP
I want to check if the ActiveCell range name is "Hello". I thought this
little macro would work but it returns a "No". What is the correct way to
make this check? Thanks for your help. Otto
Sub TestName()
If ActiveCell.Name = "Hello" Then
MsgBox "Yes"
Else
MsgBox "No"
End If
End Sub