match cell to range
Another way
On Error Resume Next
iRow = Application.Match(Range("X9").Value,Range("H5:H200 "),0)
On Error Goto 0
If iRow 0 Then
Range("V8").Value = Range("H5:H200").Offset(iRow-1,-2).Value
Else
MsgBox "Not found"
End If
--
HTH
Bob Phillips
(replace xxxx in the email address with gmail if mailing direct)
"Nigel" wrote in message
oups.com...
Set rng = Range("H5:H200")
For Each c In rng
If c.Value = Range("X9").Value Then
FoundRow = c.Row
Range("F" & FoundRow).Value = Range("V8").Value
Exit For
End If
Next c
so i am trying to look for the value of X9 in the range h5:h200
when i find the match...i wanted to take the value of column F in the
same row as the found match, and set V8 to the same value.....
i have a feeling its not even running through the if then statement
tho....but im not sure.....
whats wrong? thx
|