Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get the position of a cell in Excel named range?
This should get you started. It assumes that your named range is
MyRange, that you are looking for the value 172 on the ActiveSheet, and that you are looking for the first occurence of that value. Of course, these assumptions are probably simplified and the code may require modification. Sub ColRow() Dim lngRow As Long, lngCol As Long Dim rngFind As Range With ActiveSheet.Range("MyRange") Set rngFind = .Find(what:=172, LookAt:=xlWhole) If Not rngFind Is Nothing Then lngCol = rngFind.Column lngRow = rngFind.Row End If End With End Sub HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- On Wed, 9 Jul 2003 18:40:09 -0700, "Alan White" wrote: Hi Groups, I'd like to know if someone could show me how to get the position (col, row) of a cell in excel named range. What I need to do is: I will need to loop through a named range to find a particular cell by value, once I found it, I need to know the position of that cell. I'm doing this with C#, but any VB code would be help too. Thanks!. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referring to specific cell in named range in Excel formula | Excel Worksheet Functions | |||
Referencing a named range based upon Range name entry in cell | Excel Worksheet Functions | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Position of a cell in a range | Excel Worksheet Functions | |||
How to get the position of a cell in Excel named range? | Excel Programming |