+ Reply to Thread
Results 1 to 12 of 12

Run time error 13 on VBA code

  1. #1
    Registered User
    Join Date
    06-21-2010
    Location
    Texas, San Antonio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Run time error 13 on VBA code

    Hello all,

    I have the following code and it works great, but I keep getting a error that states

    Run time error 13
    Type Mismatch

    every time I press the delete key to delete a cell not reference in the code, is anyone able to help me figure out why I get this error?

    Please Login or Register  to view this content.

    Thanks

  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 13 on VBA code

    Hello Coldsteel,

    Try this revision...
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    06-21-2010
    Location
    Texas, San Antonio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Run time error 13 on VBA code

    Thanks for the help,

    I pasted the code, but unfortunately I keep getting the same error.

  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 13 on VBA code

    Hello Coldsteel,,

    In that case, you should post a copy of workbook for review.

  5. #5
    Registered User
    Join Date
    06-21-2010
    Location
    Texas, San Antonio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Run time error 13 on VBA code

    I made a new worksheet with the code I am trying to get to work. It did allow me to delete data out of other cells with no error but, now it wont let me have one only one x in the row. Any advice would be greatly appreciated

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Run time error 13 on VBA code

    When it opens the B5:E5 cells are blank. What are you entering and where, and what are you expecting to happen?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    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 13 on VBA code

    Hello Coldsteel,

    Perhaps this what you after. This will allow you to select one or more cells and check that at least one "x" exists.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-21-2010
    Location
    Texas, San Antonio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Run time error 13 on VBA code

    Thanks for the help

    What I am trying to do is if I type a x in the table row, only one x will appear in the row at a time. it will delete the other x's that are in the same table row.

    Thanks

  9. #9
    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 13 on VBA code

    Hello Coldsteel,

    Ah, that's the rub. Okay, I will change it to do that.

  10. #10
    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 13 on VBA code

    Hello Coldsteel,

    Okay, this worked on the workbook you posted. Give it try on your end and let me know the results.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-21-2010
    Location
    Texas, San Antonio
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Run time error 13 on VBA code

    Thank you, I have been playing with this for a while and it works great. You are the best.

  12. #12
    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 13 on VBA code

    Hello Coldsteel,

    You're welcome. Thanks for the feedback. Glad that it is working.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run Time Error with Code
    By Noob101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2014, 12:56 AM
  2. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  3. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  4. Need Help With VBA code Run-Time error 91
    By whitners_98 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2012, 12:20 PM
  5. Run-time Error 91 in MS code
    By sparklingcider in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-08-2009, 04:59 PM

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