Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking if a cell has a range name
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
|
|||
|
|||
Checking if a cell has a range name
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
|
|||
|
|||
Checking if a cell has a range name
Or: Range("J10").Select ActiveCell.FormulaR1C1 = Range("Y1"),Value Range("J11").Select ActiveCell.FormulaR1C1 = Range("Y2").Value "JLGWhiz" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking if a cell has a range name
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking if a cell has a range name
Disregard second posting, wrong thread. "JLGWhiz" wrote in message ... Or: Range("J10").Select ActiveCell.FormulaR1C1 = Range("Y1"),Value Range("J11").Select ActiveCell.FormulaR1C1 = Range("Y2").Value "JLGWhiz" wrote in message ... 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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
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 |