View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tone[_4_] Tone[_4_] is offline
external usenet poster
 
Posts: 5
Default ByRef Argument Type mismatch

I have some code that looks like:

Sub doToCells()
Dim formula As String
...
formula = InputBox(message, title, defString)
pr_doToCells formula
end sub

Private Sub pr_doToCells(formula As String)
If formula < "" Then
formula = Replace(formula, ..., ...)
...
End If
End Sub

But I get an error - ByRef Argument type mismatch when it compiles -
complaining about the "formula" used as an argument to pr_doToCells.
Cannot understand why, and the problem disappears if I put parentheses
around the "formula" argument when I call it.

Any ideas?

Thanks
Tone