+ Reply to Thread
Results 1 to 2 of 2

Proper way to write file & sheet links in VBA

Hybrid View

  1. #1
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    1

    Proper way to write file & sheet links in VBA

    Dear all,

    I am fairly new to Microsoft Excel VBA. Currently while making in a certain VBA project I am writing the following input but getting an error in return.

     ActiveCell.FormulaR1C1 = _
            "=IFERROR(VLOOKUP(RC4,'[D:\SDD Files\Reference File.xlsx]EBS Stock'!Table1[[Original Name(Plaza)]:[Zone Name]],2,0),"""")"
    D:\SDD Files\Reference File.xlsx = File Name

    EBS Stock = Sheet Name

    Table1 = Automated generated table of data

    Can anyone please tell me where am i going wrong here.. Thanks in advance.

    Regards,

    Sourav
    Last edited by JBeaucaire; 10-24-2016 at 03:07 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Proper way to write file & sheet links in VBA

    THe brackets go around the filename, not the full path. That's the only edit I've made, can't test your formula as a whole:

    ActiveCell.FormulaR1C1 = _
            "=IFERROR(VLOOKUP(RC4,'D:\SDD Files\[Reference File.xlsx]EBS Stock'!Table1[[Original Name(Plaza)]:[Zone Name]],2,0),"""")"
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. Too Many Nested Levels - What's the PROPER way to write this formula?
    By teddystiles in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-02-2015, 01:16 PM
  2. [SOLVED] can't write proper if statement
    By ghuber34 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-17-2014, 12:38 PM
  3. Replies: 6
    Last Post: 07-18-2013, 02:34 AM
  4. Write Sheet to text file, comma delimited.
    By Screamtruth in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2010, 06:16 AM
  5. Good Links that Discuss Proper Programming Technique
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2009, 11:16 AM
  6. [SOLVED] Maintain proper links when Excel cells are moved
    By Excelnovice in forum Excel General
    Replies: 0
    Last Post: 02-19-2006, 02:20 PM
  7. Proper way to write a conditional statement with ands
    By DKY in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 07-18-2005, 12:08 PM

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