+ Reply to Thread
Results 1 to 6 of 6

Open File Using Path in One Cell and Filename in Another Cell

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Open File Using Path in One Cell and Filename in Another Cell

    Hey Everyone!

    It's been a little while since I've written a macro so I'm kinda rusty - I did some google'ing but couldn't find exactly what I'm going for.

    The easiest way to put it:

    If A1 is "YES", then open the file where the folder path is in B1 and the filename is in B2. If A1 does not say "YES", then don't run the macro.

    Thanks in advance!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Open File Using Path in One Cell and Filename in Another Cell

    What kind of file is it?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Open File Using Path in One Cell and Filename in Another Cell

    Its opening a xlsm file

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Open File Using Path in One Cell and Filename in Another Cell

    I assume it's workbook that you are trying to open and that you have the worksheet with stored values active.

    Something like...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  5. #5
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Open File Using Path in One Cell and Filename in Another Cell

    Possibly...
    Please Login or Register  to view this content.
    placed in the sheet's code module.

  6. #6
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Open File Using Path in One Cell and Filename in Another Cell

    Both worked! 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. Open file path from cell, paste into new sheet named from another cell and loop
    By LAUGHINGCROW in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2019, 12:09 PM
  2. Save File with set path + cell value as filename - code require fix
    By heatwave in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2017, 03:04 PM
  3. [SOLVED] Workbook.open a filename with path and cell value in it
    By dutchmaste in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-16-2016, 09:02 PM
  4. Need to play a wav file based on path and filename in a selected cell using macro: SOLVED!
    By needtoregistersux in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-31-2016, 07:47 PM
  5. Find filename and path of a linked file in another cell
    By Tsangman007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-02-2015, 01:35 AM
  6. [SOLVED] open file with cell value as filename
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2014, 08:49 AM
  7. Open File which path is in a cell
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2012, 07:54 AM

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