Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used the following code to get the name of a cell:
dim a as string a = ActiveCell.name.name Can I do something similiar to get the name of a range of cells? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are you trying to get a Name or address?
This code get an address a = Selection.Address Use intersect to check if cell is the range of a named item Sub test() For Each nm In ThisWorkbook.Names nmRange = Mid(nm, 2) Set isect = Application.Intersect(Range(nm), ActiveCell) If isect Is Nothing Then MsgBox "Ranges do not intersect" Else MsgBox "Ranges ntersect" End If Next nm End Sub "ranswert" wrote: I used the following code to get the name of a cell: dim a as string a = ActiveCell.name.name Can I do something similiar to get the name of a range of cells? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim A as string
a = "" on error resume next a = activesheet.range("a1:x99").name.name on error goto 0 if a = "" then msgbox "no name for that range" else msgbox a end if ranswert wrote: I used the following code to get the name of a cell: dim a as string a = ActiveCell.name.name Can I do something similiar to get the name of a range of cells? Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |