Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Find Value searching UP

Hey

I need to find the last value in a range. Lets say I have values in
A1:A10. In A2:A5 the value is "test". In all other cells in this
range the values are different. My lookup value is "test" I would
like for a vba code to return A5 as A5 is the last cell in the range to
contain my lookup value.


Thanks
todd

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Find Value searching UP

Sub Foo()
Set Rng = Range("A1:A10")
rcount = Rng.Rows.Count
For i = rcount To 1 Step -1
If Cells(i, 1) = "test" Then
MsgBox "Found test at " & Cells(i, 1).Address
Exit Sub
End If
Next i
End Sub

"Todd Huttenstine" wrote:

Hey

I need to find the last value in a range. Lets say I have values in
A1:A10. In A2:A5 the value is "test". In all other cells in this
range the values are different. My lookup value is "test" I would
like for a vba code to return A5 as A5 is the last cell in the range to
contain my lookup value.


Thanks
todd


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Find Value searching UP

See your other thread

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Todd Huttenstine" wrote in message
oups.com...
Hey

I need to find the last value in a range. Lets say I have values in
A1:A10. In A2:A5 the value is "test". In all other cells in this
range the values are different. My lookup value is "test" I would
like for a vba code to return A5 as A5 is the last cell in the range to
contain my lookup value.


Thanks
todd



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
Searching or Find question excelneophyte Excel Discussion (Misc queries) 5 July 18th 08 11:31 PM
Microsoft Excel cannot find data you are searching for Gabi Excel Worksheet Functions 1 October 5th 07 02:21 PM
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
changing the default type of searching in the find function Jose Roberto Excel Discussion (Misc queries) 1 November 29th 05 12:51 AM
Find (Ctrl +F) not searching all open sheets Caroline Excel Worksheet Functions 2 January 22nd 05 05:45 PM


All times are GMT +1. The time now is 11:30 PM.

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"