+ Reply to Thread
Results 1 to 7 of 7

Run-time error '424': Object-required

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Run-time error '424': Object-required

    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.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Run-time error '424': Object-required

    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 Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Run-time error '424': Object-required

    I'm sorry. It's erroring out at
    Please Login or Register  to view this content.
    in the last section of the code shown above.

    I did think about the table name issue and the table is named correctly.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Run-time error '424': Object-required

    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.

  5. #5
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Run-time error '424': Object-required

    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.

    Please Login or Register  to view this content.
    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.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Run-time error '424': Object-required

    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.

  7. #7
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Run-time error '424': Object-required

    Ugh. Duh, no I forgot to change it to zero. Works perfectly! Thank you. Will mark case solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1