+ Reply to Thread
Results 1 to 4 of 4

Run-time error 1004

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    scottsdale, az
    MS-Off Ver
    Excel 2007
    Posts
    2

    Smile Run-time error 1004

    Hello,

    I'm new to creating macros in excel and I've just taken over a project that's pretty macro heavy. The problem is that the macro's work but they aren't pulling the right data from the right places. I'm in the process of rewriting these macros. I get the Run-time error ,1004,: Application-defined or object-defined error on these lines:

    Please Login or Register  to view this content.
    Oddly enough, when I recorded the macro in excel and finish the recording it worked but when I run the macro I get the error. I've done this about a dozen times and I've been staring at the screen for hours. I've googled and binged this error all day but I haven't had an ounce of luck finding a solution.

    If possible, could you take a look and tell me what is wrong and how to fix it? Also, any other advice you could give this rookie would be great!

    I appreciate any help!

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

    Re: Run-time error 1004

    I can see one problem straight off, you are mixing A1 and R1C1 notation.

    You can only use one type of notation in a formula.

    Also, it looks to me like you may run into problems with the no of nested ifs in the formula.

    If might be worth looking into refining it - perhaps a lookup up on RC[-7] to find the column for the VLOOKUP.

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    scottsdale, az
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Run-time error 1004

    Thanks for the quick response!

    The problem I run into when doing a vlookup based on RC[-7] is that the value may be different for every change in RC[-9].

    I know a little about A1 and R1C1 notation. Is the data being pulled from the master database not in R1C1 format? Ie; ..."master database'C1:C62"? If so, would bracketing the numbers help? Or am I completely off?

  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: Run-time error 1004

    I took a closer look and it does seem to be C1:C62 that is the only part in A1 notation.

    That reference is R1C3:R62C3 in R1C1.

    I'm not sure I understand where RC[-9] comes into things, I meant to use the lookup to find the column based on the value in RC[-7].

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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