Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Locate values in range

Not sure if this can be done with cell formulas...

I want to create a function so that given a range that is 20 x 30, it
would return the row and column coordinated for each cell containing a
particular value (the letter "N").

Any idea if this doable with functions? or would this require VBA?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Locate values in range

Try this small UDF:

Function nFinder(r As Range) As String
nFinder = ""
For Each rr In r
If rr.Value = "N" Then
If nFinder = "" Then
nFinder = rr.Address
Else
nFinder = nFinder & ", " & rr.Address
End If
End If
Next
End Function


UDFs are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To use the UDF from the normal Excel window, just enter it like a normal
Excel Function. For example:
=nFinder(A1:Z100)

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about UDFs, see:

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx

--
Gary''s Student - gsnu200817


"Matt" wrote:

Not sure if this can be done with cell formulas...

I want to create a function so that given a range that is 20 x 30, it
would return the row and column coordinated for each cell containing a
particular value (the letter "N").

Any idea if this doable with functions? or would this require VBA?

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
locate a cell value within a range and return its reference Adam Excel Discussion (Misc queries) 0 April 8th 08 11:23 AM
Need a formula to locate the blank cells within the range Sasikiran Excel Discussion (Misc queries) 2 June 20th 07 03:52 PM
locate and SUM values from LOOKUP rows? Minx Excel Worksheet Functions 2 October 17th 06 10:34 PM
Locate month n year from range of date Rao Ratan Singh New Users to Excel 1 March 2nd 06 09:13 AM
How can I locate the second to last value in a range? A shink Excel Worksheet Functions 5 June 4th 05 01:17 AM


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