+ Reply to Thread
Results 1 to 3 of 3

VBA Code to open File from formula result

  1. #1
    Registered User
    Join Date
    01-05-2010
    Location
    liverpool, england
    MS-Off Ver
    Excel 2007
    Posts
    44

    VBA Code to open File from formula result

    Hi All

    I am currently using a macro which amongst other things opens a file collects data from in then pastes it onto the current worksheet.

    The problem is the file name which I require to open changes every day. I have written a formula into a cell to hyper link the correct file name however do not know how to work this into the macro below.

    Hope someone can help

    Cheers

    File Name Formula:

    "Z:\Backup\backup_"&TEXT(TODAY(),"yyyy-mm-dd")&"_0600\waw_29_"&TEXT(IF(WEEKDAY(TODAY()-1)=1,TODAY()-2,TODAY()-1),"yyyy-mm-dd")&"_val_v001.csv"

    Macro:

    Please Login or Register  to view this content.
    Last edited by WAW; 09-23-2010 at 04:26 AM. Reason: code tags required

  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: VBA Code to open File from formula result

    Something like this:

    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!)

  3. #3
    Registered User
    Join Date
    01-05-2010
    Location
    liverpool, england
    MS-Off Ver
    Excel 2007
    Posts
    44

    Smile Re: VBA Code to open File from formula result

    Fantastic thanks for your help greatly appreciated.


+ 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