I'm getting a run-time error at the "Delete Cash" portion of my code. Do I need to define something else?
![]()
Please Login or Register to view this content.
I'm getting a run-time error at the "Delete Cash" portion of my code. Do I need to define something else?
![]()
Please Login or Register to view this content.
Last edited by narrowgate88; 07-12-2010 at 12:22 PM.
Hello narrowgate88,
Since you didn't say which line in the code was producing the error, I have to guess. The statement to display alerts and the statement to select the used range are correct, which leaves the ListObject. Have you verified that the name "Table1" is the correct name for that object on the active sheet?
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
I'm sorry. It's erroring out atin the last section of the code shown above.![]()
Please Login or Register to view this content.
I did think about the table name issue and the table is named correctly.
Hello narrowgate88,
The Application.InputBox is a type 1, meaning it requires a number. Your Case statement is:
![]()
Please Login or Register to view this content.
The Value statement can only be used with an object, not a string, nor a number.
What I'm trying to accomplish is that if the value entered for x is zero, then the following portion of the code won't run.
So, what are you telling me to do with the select case statement? I tried just removing the .Value, but it still ran the code even though I entered 0 for x.![]()
Please Login or Register to view this content.
Hello narrowgate88,
You really need to do some reading about variable types. Your Case statement fails because it is looking to compare a String. The double quotes represents an empty string, not a numeric zero. If the Case statement does not test true then the next Case statement is evaluated, if there is one. Did you change the Case statement to look for a zero?
![]()
Please Login or Register to view this content.
Ugh. Duh, no I forgot to change it to zero. Works perfectly! Thank you. Will mark case solved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks