ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA error: "object doesn't support this property or method" (https://www.excelbanter.com/excel-discussion-misc-queries/140026-vba-error-object-doesnt-support-property-method.html)

Dave F

VBA error: "object doesn't support this property or method"
 
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
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.

Dave F

VBA error: "object doesn't support this property or method"
 
D'oh! Ignore this. The error is due to a typo:

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

Thanks,

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Dave F" wrote:

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
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


LB[_2_]

VBA error: "object doesn't support this property or method"
 
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.



"Dave F" wrote:

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
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.



All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com