View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Find a string match in a column

You omitted the third argument in the function.
Add comma, zero after MyRng
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Matilda"

wrote in message
Hi,
I am wanting to find a string from a column which matches my variable. I
modified this code of Tom Ogilvy's in a related answer

For Each cell In rngA
res = Application.Match("*" & cell.Value & "*", rngB, 0)
If Not IsError(res) Then
Set rng = rngB(res)
rng.Offset(0, 1).Value = cell
End If

to

For Each cell In rngA
res = Application.Match(myVar, MyRng)
If Not IsError(res) Then
myCode
End If
next

but I get a number in res that in fact is a blank cell. Can't work out what
is happening. Any help appreciated.