Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to specific cell in named range in Excel formula Nigel Barton Excel Worksheet Functions 3 August 18th 09 04:25 PM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Position of a cell in a range zangief Excel Worksheet Functions 4 September 27th 05 03:07 PM
How to get the position of a cell in Excel named range? acw Excel Programming 0 July 10th 03 02:57 AM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"