View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default vb programing match function

Assume your values are stored in range a1 to a3 then try this....

Sub test()
Dim r As Range, c As Range, myRow As Long, myCol As Integer
Set r = Range("A1:A3")

For Each c In r
If InStr(1, c.Value, "005040037 34") 0 Then
myRow = c.Row
myCol = c.Column
End If
Next c

MsgBox myRow
MsgBox myCol

End Sub


--

Regards,
Nigel




"Tomo" wrote in message
...
SPRING/SUMMER JANUARY Red Tab Guys 005010234 30 2
SPRING/SUMMER DECEMBER Red Tab Guys 005040037 32 4
SPRING/SUMMER DECEMBER Red Tab Guys 005040037 34 6


How to find with visual basic code in witch row and column is data with
match 005040037 and 34,
or in this case 3rd row??

Tnx in advance!