+ Reply to Thread
Results 1 to 2 of 2

How to set file path (including tab reference)

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    MTL
    MS-Off Ver
    Excel 2007
    Posts
    16

    How to set file path (including tab reference)

    Hello everyone,

    I want to create a sheet where one can enter data and that would have a macro that copies the entered data into another workbook. The destination workbook will be in another folder that the source workbbok, and contains multiple tabs that can all be potential destinations. How can I set this workbook to something easier.

    I.e. the same thing as this:

    Please Login or Register  to view this content.
    But that references outside the active workbook.

    Thanks you for any help,

    Corentin
    Last edited by JBeaucaire; 07-31-2013 at 01:11 PM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  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: How to set file path (including tab reference)

    Within VBA, you would set a WB object, then fill that object with the workbook name as you open it. Then throughout your macro, you continue to refer to that workbook by the WB variable you declared.

    Please Login or Register  to view this content.
    _________________
    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. Reference Sheet Name in File Path
    By nkworth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-29-2012, 02:31 PM
  2. [Ask] Import Text file And Call reference path file with Value Range.
    By dha_indra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 11:09 PM
  3. Using file path reference in vlookup
    By mlk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-05-2010, 02:52 PM
  4. File path including a worksheet value
    By charlezzz in forum Excel General
    Replies: 5
    Last Post: 08-22-2008, 08:23 AM
  5. [SOLVED] problem with OnAction including an unwanted file reference
    By KB in forum Excel General
    Replies: 1
    Last Post: 10-27-2005, 09:05 PM

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