Results 1 to 3 of 3

VBA Code to open File from formula result

Threaded View

  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:

    Sub Macro1()
        Workbooks.Open Filename:="C:\Users\..................xlsm"
    End Sub
    Last edited by WAW; 09-23-2010 at 04:26 AM. Reason: code tags required

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