+ Reply to Thread
Results 1 to 8 of 8

VBA Excel Error 13 with If Status. Please help me find a solution!

  1. #1
    Registered User
    Join Date
    07-09-2021
    Location
    United Kingdom
    MS-Off Ver
    10
    Posts
    13

    VBA Excel Error 13 with If Status. Please help me find a solution!

    Hi all,

    I'm having some issues with the below VBA code. Trying to get specific columns to be copied over to another sheet when "LTS" is mentioned in a column.

    The below code is what i have so far, but i keep getting an error on the last If Status = "LTS", stating Type Mimatch Error 13.

    Please help!

    Please Login or Register  to view this content.
    Last edited by BettyMay; 08-10-2021 at 11:07 AM. Reason: Tags

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,198

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    Without a sheet it is hard to be specific, but could you be trying to paste a full column into a cell part way down the column?

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    07-09-2021
    Location
    United Kingdom
    MS-Off Ver
    10
    Posts
    13

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    I have sanitised the workbook and attached it Thank you for your help!!!
    Attached Files Attached Files

  5. #5
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,709

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    Hi BettyMay,

    If my understanding is correct, try below code which should copy all "LTS" Type of Absence from sheet4 (Absence Tracker) to sheet1 (Report)
    Please Login or Register  to view this content.
    Last edited by nankw83; 08-10-2021 at 12:08 PM.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  6. #6
    Registered User
    Join Date
    07-09-2021
    Location
    United Kingdom
    MS-Off Ver
    10
    Posts
    13

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    Hi there,

    No luck im afraid. There's no error message, just doesnt do anything.

  7. #7
    Registered User
    Join Date
    07-09-2021
    Location
    United Kingdom
    MS-Off Ver
    10
    Posts
    13

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    Just wanted to say, major user error!

    It works wonderfully. Thank you so much for your help. SOLVED!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: VBA Excel Error 13 with If Status. Please help me find a solution!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. VBA : Simple use of the Status Bar, and a Progress Bar solution
    By Stormin' in forum Tips and Tutorials
    Replies: 0
    Last Post: 07-18-2017, 07:54 AM
  2. [SOLVED] Subscript is out of range Error - can't find solution
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-16-2016, 12:18 PM
  3. Replies: 5
    Last Post: 06-28-2015, 08:28 PM
  4. Using VBA to set Error Trapping Status (Excel)
    By Conrad Green in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-13-2014, 01:22 PM
  5. Use Solver in excel to find a solution to this set of equations.
    By lovejohn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2014, 11:11 AM
  6. Problem with Excel Solver not able to find a solution while there should be one
    By mauzzzzz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2013, 02:13 PM
  7. Find status using Excel search function
    By Dyzone in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-21-2012, 09:06 AM

Tags for this Thread

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