View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Please help me find the problem with this

I have the following function:

Function MyRow(pattern As String)

oWB.Activate
oWS.Activate
Debug.Print "In MyRow function"
For i = 1 To 15
'Debug.Print i, Cells(i, "B").text, pattern
If Cells(i, "C").text Like pattern & "*" Then
MyRow = i
aWB.Activate
aWS.Activate
Debug.Print "MyRow = ", MyRow, Cells(i, "B").text, pattern
Exit Function
End If
Next i

End Function

I want to use it in the following formula

ActiveCell.FormulaR1C1 = _
"=FORMULATEXT(INDIRECT(RC8&""$I$13"",TRUE))"

In place of the 13. I know that the function is returning what I'm looking
for, but I just can't get it to work in the above formula. Can someone
assist?