Ed,
I wonder why it doesn't work for you. For me it works with more than one
cell, a block of cells or even a multiple range, providing the range is
exactly a named range. If a multiple range it would need to be selected in
the same order as defined.
Regards,
Peter T
"Ed" <ed_millis@NO_SPAM.yahoo.com> wrote in message
news:OgS$gwa8EHA.3376@TK2MSFTNGP12.phx.gbl...
> Peter: Sorry, but it didn't work. I think it has something to do with
the
> restrictions mentioned by Tom - it doesn't seem to work if the range
> contains more than one cell. So I'll use the loop macro I have.
>
> Thanks for the input.
> Ed
>
> "Peter T" <peter_t@discussions> wrote in message
> news:On$Hyoa8EHA.1452@TK2MSFTNGP11.phx.gbl...
> > Ed,
> >
> > Sub test()
> > Dim rng As Range, str As String
> > Set rng = Selection 'or activecell etc
> > On Error Resume Next
> > str = rng.Name.Name
> > If Err.Number Then
> > str = "Unamed"
> > Err.Clear
> > End If
> > MsgBox rng.Address & vbCr & str
> > End Sub
> >
> > Regards,
> > Peter T
> >
> > "Ed" <ed_millis@NO_SPAM.yahoo.com> wrote in message
> > news:e73SWda8EHA.1264@TK2MSFTNGP12.phx.gbl...
> > > Is there an easy way to get the name of the range containing the
> > ActiveCell?
> > > I have a macro that loops through all the names in the workbook and
sees
> > if
> > > they intersect with the ActiveCell - but isn't there an easier way? I
> > tried
> > > ActiveCell.Range.Name, and getting the row and column references for
> > > Cells(r,c).Range.Name, but nothing worked.
> > >
> > > Ed
> > >
> > >
> >
> >
>
>
Bookmarks