PDA

View Full Version : Simple If Statement: Comparing function argument



Cheesecube
05-16-2020, 02:23 AM
I have a simple function but I have no idea why this doesn't work



Function io(InStr As String) As String
If InStr = "1" Then
io = "2"
End If
End Function


I keep on getting error "Expected: (" at the If statement

I can't figure out why



If "A" = "B" Then
End If


this code works, the previous one doesn't

Bob Phillips
05-16-2020, 02:52 AM
It is because InStr is a VBA reserved word. Call it something else.