+ Reply to Thread
Results 1 to 5 of 5

Runtime 424 error

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    2010
    Posts
    10

    Runtime 424 error

    I am encountering a runtime 424 Object required error error with the following code and tearing my hair out. Any help in identifying the possible reason for the error would be much appreciated.

    Purpose: The code takes data from a particular cell, checks whether its 'AAA' or 'BBB' or not and if it is taking the next cell and concatenating __1111 to it. The concatenated value is then posted in a separate cell

    Dataset (last two columns are used)
    NV B AEX AAA 123
    NV B AEX AAA 456
    XO B CAXE BBB 312
    XO B CAXE CCC 334
    BL B EDXE DDD 555

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 07-22-2015 at 11:08 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Runtime 424 error

    When asking help about an error message, always indicate the line of code where it is occurring. I do not see an obvious cause of the error you quoted, and do not have your file to be able to run a test. Can you indicate the line, or attach your file?

    Also, I will bet that your declarations do not do what you think they are doing. For example,
    Please Login or Register  to view this content.
    does not declare four variables as Integer. It declares filledrowcount as Integer, and defaults all the others to Variant. Please see this excellent page on declarations.

    This line of code works perfectly well but is deceiving in intent:
    Please Login or Register  to view this content.
    A much cleaner and obvious test would be
    Please Login or Register  to view this content.
    Using ActiveSheet unnecessarily can introduce bugs that are hard to diagnose. In this case you are always using Worksheets("Sheet1"), so there is no need to active it and refer to ActiveSheet. I recommend you modify your code as follows:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    2010
    Posts
    10

    Re: Runtime 424 error

    Thanks a lot for the detailed feedback 6stringjazzer...very new to coding so yeah am still a bit green behind the ears :D....will incorporate the changes mentioned.

    The error comes on the if statement.

    Can't attach the actual file I am afraid....it contains sensitive data. Let me know if there are any more qs!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Runtime 424 error

    It should be a comma between rowcount and colcount1 in Cells.

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    2010
    Posts
    10

    Re: Runtime 424 error

    Norie - Thanks a lot....the dots completely escaped my attention!!!...problem solved! You rock!!!

+ 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. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  2. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  3. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  4. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  5. runtime error 3265 error in a VBA Query to pull info from ERP Database
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-12-2010, 03:59 PM
  6. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 AM
  7. Excel 2003 Macro Error - Runtime error 1004
    By Cow in forum Excel General
    Replies: 2
    Last Post: 06-07-2005, 09:05 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