View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Jaybird[_3_] Jaybird[_3_] is offline
external usenet poster
 
Posts: 30
Default VBA Function for Match and Offset

Sub findit()
On Error Resume Next
Dim i As Long
Dim myvalue As String

For i = 5 To Cells(Rows.Count, "G").End(xlUp).Row
myvalue = Columns("H").Find(Cells(i, "G")).Offset(, 3)
MsgBox (myvalue)
Next i
End Sub

This is the current version of the code you gave me. I'm no longer
getting the error (I didn't notice the ' until now), but the message
box doesn't say anything, so I don't know if it's working or not. Let
me see if I'm reading this right...

"Look for the data in column G in column H and then tell me if you
find a match in a message box, but offset the results by 3 columns."

Typing that out helped. I realized that the offset WAS working, and
throwing off my expected results. Took it out and the results of the
search show up in a message box. Thanks for everything. I'll
continue working on this to take the form that I want and ask more
questions as they come up.