+ Reply to Thread
Results 1 to 3 of 3

Error in this macros when there are no records

  1. #1
    Registered User
    Join Date
    09-02-2019
    Location
    Chile
    MS-Off Ver
    2013
    Posts
    1

    Error in this macros when there are no records

    Hello guys , i have the next problem in this macro . I will explain what this macro does first. On sheet 202 you should cycle through the codes in column C, checking that the same code has been incorporated in column D of sheet 1502. In case any code is not found on sheet 1502, the macro should check if found in the column of sheet 1503. If it is not found in this sheet, you should put a value on the sheet "Macros".


    Please Login or Register  to view this content.
    the error that it presents is error 13 the types do not match. in this line ReDim y(1 To UBound(x, 1), 1 To 1)

    please help me

    Regards

  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: Error in this macros when there are no records

    Hello NerakSeven,

    Welcome to the forum!

    The error indicates that the last row, variable lr, is 1. There must be 2 or more cells present to create an array of Range values.
    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 Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Error in this macros when there are no records

    Quote Originally Posted by NerakSeven View Post
    Please Login or Register  to view this content.
    the error that it presents is error 13 the types do not match. in this line ReDim y(1 To UBound(x, 1), 1 To 1)
    [Untested] Maybe making the changes I show in red above will solve the problem.

+ 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. [SOLVED] VBA Excel - macros for sorting, filtering and removing duplicated records from DB
    By tuspilica in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2017, 06:52 AM
  2. Matrix to Line records ( Totally new to Macros)
    By Corintan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2017, 02:53 AM
  3. Help with 2010 Macros. Break records to individual rows.
    By excelhelpneeds in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2014, 05:13 PM
  4. [SOLVED] Copy Records where records = "a" at Column B - Syntax Error
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-11-2013, 08:04 AM
  5. Filter records using excel 2007 macros not working
    By soundar.vit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2013, 08:18 AM
  6. Replies: 1
    Last Post: 11-24-2012, 02:05 PM
  7. Replies: 5
    Last Post: 07-26-2012, 09:38 PM

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