View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
DISMfish DISMfish is offline
external usenet poster
 
Posts: 22
Default Search Column then Paste Data at end of Row?

Brian,
I was able to get your solution working. Thanks!

Here's my final code. (I have implemented the running tally.) I also
had to change the search criteria b/c it would give me an error if it
found nothing.

Dim intFirstHit As Integer
Dim eFinder As Variant

'you can change this range to be what you want
With Worksheets(strName).Range("B1:B" & Num_eRows)
.Select
'Find first hit
Set eFinder = .Find(What:=eNameVar, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)

If Not eFinder Is Nothing Then
'Mark First Hit
intFirstHit = eFinder.Row
Range("Q" & eFinder.Row).Value = e_Min_val
Range("R" & eFinder.Row).Value = e_Max_val
Set eFinder = .FindNext(After:=eFinder)

'Do until you wrap around to the top of the selection
Do While eFinder.Row intFirstHit
Range("Q" & eFinder.Row).Value = e_Min_val
Range("R" & eFinder.Row).Value = e_Max_val
'Find each other instance
Set eFinder = .FindNext(After:=eFinder)
Loop
End If
End With