View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Limit Find to a single column

I am still a little vague on exactly what you wnat but give this a try...

Sub test()
Dim rng As Range

Set rng = FindStuff("A3B")
If Not rng Is Nothing Then MsgBox rng.Address
Set rng = FindStuff("A30B")
If Not rng Is Nothing Then MsgBox rng.Address

End Sub

Public Function FindStuff(ByVal strTofind As String) As Range
Dim rngToSearch As Range
Dim wksToSearch As Worksheet

Set wksToSearch = Sheets("Sheet1")
With wksToSearch
Set rngToSearch = .Range(.Range("J2"), .Cells(Rows.Count, "J").End(xlUp))
End With
Set FindStuff = rngToSearch.Find(What:=strTofind, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
End Function
--
HTH...

Jim Thomlinson


"merritts" wrote:


First, Thanks for all your help. I really appreciate it.

I will be taking values from another workbook in column G then
searching column J for that value. If the value (an alpha-numeric
combination) match the F columns (only numeric) will be summed. There
should only be one match in that column, but not the spreadsheet as a
whole. That is why i would like to limit it to one column.


--
merritts
------------------------------------------------------------------------
merritts's Profile: http://www.excelforum.com/member.php...o&userid=35803
View this thread: http://www.excelforum.com/showthread...hreadid=558592