+ Reply to Thread
Results 1 to 7 of 7

Runtime error 1004 - Application Defined or Object Defined error

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    21

    Angry Runtime error 1004 - Application Defined or Object Defined error

    I have a macro, that worked before I put in a For...Next Statement. Now I get an error which did not happen before the changes. The error reads: Runtime error 1004 - Application Defined or Object Defined error.

    The line on which I get the error is as follows: ActiveSheet.Range("J" & ROW_NO).Select and I cannot figure out why. The ROW_NO is defined as Dim ROW_NO As Long and is initialised as follows:ROW_NO = 2

    For the sake of completeness, I supply the entire code below:



    Please Login or Register  to view this content.
    Last edited by andreroux; 06-06-2013 at 10:32 AM. Reason: Use tags to use less page space

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Runtime error 1004 - Application Defined or Object Defined error

    Andre,
    Please use code tags with your code. The code has almost filled-up the entire page.

  3. #3
    Registered User
    Join Date
    06-06-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    21

    Re: Runtime error 1004 - Application Defined or Object Defined error

    HI AB33

    Sorry about that. Only figured out now how to do it. Big OOPS on my side.

    Thanx for helping me right

    Andre

  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 error 1004 - Application Defined or Object Defined error

    When you get the error ROW_NO has no value.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    06-06-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    21

    Re: Runtime error 1004 - Application Defined or Object Defined error

    Hi Norie

    I see what U r saying. But at the beginning of the macro, I do give ROW_NO a value of 7 with the line: ROW_NO = 7. Maybe U are seeing something that I am missing. I am, after all, a novice with VBA

    Regards

    Andre

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

    Re: Runtime error 1004 - Application Defined or Object Defined error

    Andre

    You've declared and given ROW_NO a value in the first sub (Macro1), it's not recognised in the second sub (DoWork).

  7. #7
    Registered User
    Join Date
    06-06-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010 and Excel 2013
    Posts
    21

    Re: Runtime error 1004 - Application Defined or Object Defined error

    Hi Norie,

    THanx for pointing me in the right direction. It is all about logic! I still have other small problems, but I think I can handle that now that I know how VBA thinks

    Thanx a lot!

    Andre

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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