+ Reply to Thread
Results 1 to 5 of 5

Error 2015 when trying to put vlookup into a cell

  1. #1
    Registered User
    Join Date
    02-08-2008
    Posts
    35

    Error 2015 when trying to put vlookup into a cell

    I've written a small macro and everything was going fine until I tried to input a formula into a given cell, when the macro runs to this point I get a "Run-time error '1004': Application-defined or object-defined error" and when I check the line I've found that it gives me a "error 2015" which appears to be date related according to microsoft but that makes little sense to me.
    Please Login or Register  to view this content.
    I get the error on the last line of my code but strangly it doesn't happen if I cut it down to just "=(FM_ValExport!" & RA & ")".
    Any suggestions are appreciated.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Error 2015 when trying to put vlookup into a cell

    What is the content of RA when the code fails?

    Can you post workbook data example to better illustrate the errors?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Error 2015 when trying to put vlookup into a cell

    What awful code.
    I'm not going to rewrite it properly, but I think the problem is RA -
    On creation, RA is an address (string which would look like "$A$1" or similar) - you're trying to insert it into a cell (I think activecell without definition uses .value) in which you're defining what looks like a formulaR1C1 reference.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Error 2015 when trying to put vlookup into a cell

    As per CC's suggestion, try this code to get correct notation of cell address.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-08-2008
    Posts
    35

    Re: Error 2015 when trying to put vlookup into a cell

    Awful code it might be, sadly that is all I can manage.

    That does indeed work thanks Andy and CC.

+ 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