LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Which Element in Range?

I presume you are searching a one-dimension range, i.e. all or part of one
row or one column, it would be something like this:

(I put "Test" into cell "D1" and am searching the entire row 1 starting at
cell "C1", ItemNo returns 2)

Dim ItemNo As Long

ItemNo = Range("C1").EntireRow.Find( _
What:="Test", LookIn:=xlValues, _
LookAt:=xlWhole).Column - _
Range("C1").Column + 1


MatchingCell

"Stratuser" wrote:

I have code that finds a cell somewhere in a range. What is the code for
determining the item number of the cell within the range (i.e., the found
cell is the nth cell within the range).




 
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
look for missing element SteveDB1 Excel Worksheet Functions 1 August 7th 08 04:01 PM
How does one refer to the n-1 element of a named range? Charles Hewitt Excel Discussion (Misc queries) 2 November 26th 05 06:56 AM
Selecting the i-th element from a range [email protected] Excel Worksheet Functions 2 November 16th 05 03:19 PM
Mapping an XML element more than once?? AStarWithin Excel Discussion (Misc queries) 1 May 3rd 05 12:39 PM
VBA- Contains any element digiphotogirl Excel Programming 1 March 11th 05 10:41 PM


All times are GMT +1. The time now is 05:32 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"