+ Reply to Thread
Results 1 to 4 of 4

Application defined error with VBA formula using name of tab in formula

  1. #1
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    120

    Application defined error with VBA formula using name of tab in formula

    Hi - getting Runtime Error 1004 - application defined or object defined error on

    ActiveCell.FormulaR1C1 = _

    "=VLOOKUP(" & InvestorID & ",'CapCall Mgmt Fee Temp'!C2:C12,4,0)"

    below. The InvestorID I am using the name of the tab which is 12366XY. Once I get this squared away I want to run this through each tab, that has a tab name ending with "XY".

    Any help with current error would be appreciated.

    Thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,996

    Re: Application defined error with VBA formula using name of tab in formula

    Your lookup range is one column (C2:C12), but you are trying to return a value from the non-existant 4th column of the range:
    Maybe
    VLOOKUP(" & InvestorID & ",'Mgmt Temp'!C2:F12,4,0)
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    120

    Re: Application defined error with VBA formula using name of tab in formula

    Appreciate the response!

    The C is representative of columns so its referring to Columns 2 through columns 12.

    It has something to do with the name of the tab although I can not figure out what.

    What I change the formula to have the actual name of the tab in the formula it works.

    ActiveCell.FormulaR1C1 = _

    "=VLOOKUP(""12366XY"",'CapCall Mgmt Fee Temp'!C2:C12,4,0)"

    any other thoughts?

    Thanks

  4. #4
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    120

    Re: Application defined error with VBA formula using name of tab in formula

    Figured it out. Needed more quotation marks

    ActiveCell.FormulaR1C1 = _

    "=VLOOKUP(""" & InvestorID & """,'Mgmt Temp'!C2:C12,4,0)"

    Thanks

+ 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] Formula, VBA, Run-time error 1004 - Application-defined or object-defined error
    By dude6571 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2019, 07:54 AM
  2. [SOLVED] getting application defined or object defined error through vba formula
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2018, 01:32 AM
  3. Replies: 1
    Last Post: 03-12-2014, 12:42 PM
  4. Replies: 1
    Last Post: 05-06-2013, 06:07 AM
  5. Application-defined or object-defined error with vba .formula
    By RogerKMiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2013, 03:37 PM
  6. Application-defined or Object-defined error on Formula entry
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2009, 01:33 PM
  7. How to set a formula in a cell? Application-defined error.
    By John Wirt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-18-2005, 11:06 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