Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() One way: Sub dk() MsgBox ActiveCell.Name.Name End Sub "James Price at Premier" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try: Sub WhatsInAName() On Error GoTo noname n = ActiveCell.Name MsgBox ("cell has a name") Exit Sub noname: MsgBox ("cell has no name") End Sub -- Gary''s Student - gsnu200858 "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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking one cell, if number is a range then this | Excel Worksheet Functions | |||
Spell Checking with checking cell notes | Excel Discussion (Misc queries) | |||
Checking a cell against a named range | Excel Worksheet Functions | |||
Checking a range with IF | Excel Discussion (Misc queries) | |||
Checking range of cells for entry then checking for total | Excel Programming |