VBA error: "object doesn't support this property or method"

G

Guest

What does this error mean?

Here's my code:

Sub EnterPerClientFee()
Dim MyString As String
MyString = Application.InputBox("Enter anticipated per-client fee")
Worksheets("Analysis").Range("b20") = MyString
If Worksheets("Analysis").Range("J17") = "TRUE" Then
Exit Sub
Else
MyString = Application.InputsBox("Error. Re-enter anticipated
per client fee")
End If
Worksheets("Analysis").Range("B20") = MyString
End Sub

J17 is a data validation check to make sure that the value entered in B20
matches a value in range B3:B13: =ISNUMBER(MATCH(B20,B3:B13,0))

Basically, I want Excel to check if J17 resolves to TRUE, and, if so, leave
the value in B20, else prompt for a value that matches a value in B3:B13.
What am I doing wrong here?

Thanks,

Dave
 
G

Guest

D'oh! Ignore this. The error is due to a typo:

Application.InputsBox should be InputBox (no 's')!

Thanks,

Dave
 
G

Guest

Hi,
You've writen ".InputsBox("Error. Re-enter anticipated per client fee")"
which is a typo.

InputsBox needs to be changed to InputBox.

I find it helpful to write code in lower case, then if excel understands
commands it changes them to mixed case. If they stay as lower case I know
I've made an error.

Hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top