Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking for named ranges in a workbook
Hello! Can anyone help me with the following problem: I have some ranges in my workbook, and I want to check if the content of a cell is the name of a range. For example: I have : range1 range2 range3 range4 range5 I want to see if ActiveCell.Offset(0,-2).Value is one of the named ranges in the workbook. How can I make that check??? Thanks in advance, Chris -- loopoo ------------------------------------------------------------------------ loopoo's Profile: http://www.excelforum.com/member.php...o&userid=28792 View this thread: http://www.excelforum.com/showthread...hreadid=487273 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking for named ranges in a workbook
Hi Chris,
Try something like: '========== Sub aTest() Dim rng As Range Dim nme As Name Set rng = ActiveCell '<<==== CHANGE For Each nme In ActiveWorkbook.Names If UCase(nme.Name) = UCase(rng.Offset(0, -2).Value) Then MsgBox "valid name" Exit Sub End If Next nme MsgBox "No corresponding name found" End Sub '<<========== --- Regards, Norman "loopoo" wrote in message ... Hello! Can anyone help me with the following problem: I have some ranges in my workbook, and I want to check if the content of a cell is the name of a range. For example: I have : range1 range2 range3 range4 range5 I want to see if ActiveCell.Offset(0,-2).Value is one of the named ranges in the workbook. How can I make that check??? Thanks in advance, Chris -- loopoo ------------------------------------------------------------------------ loopoo's Profile: http://www.excelforum.com/member.php...o&userid=28792 View this thread: http://www.excelforum.com/showthread...hreadid=487273 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking for named ranges in a workbook
Thanks a lot, That helped me to do exactly what I wanted. Chris -- loopoo ------------------------------------------------------------------------ loopoo's Profile: http://www.excelforum.com/member.php...o&userid=28792 View this thread: http://www.excelforum.com/showthread...hreadid=487273 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transfering 100 named ranges to an another workbook | Excel Discussion (Misc queries) | |||
Phantom named ranges in a workbook? | Excel Discussion (Misc queries) | |||
Linking to named ranges in another workbook | Excel Discussion (Misc queries) | |||
SQL query a workbook - too many named ranges? | Excel Programming | |||
Workbook not recognising named ranges | Excel Programming |