Consulting

Results 1 to 3 of 3

Thread: Opening another file with title equal to a cell entry

  1. #1
    VBAX Regular
    Joined
    Jul 2008
    Posts
    12
    Location

    Opening another file with title equal to a cell entry

    Hi, I want to create a macro that opens a file from a folder with name equal to a cell entry in the spreadsheet. For example, I have a file named 02.09.2009.xls on the network. I enter this date in a spreadsheet named entry.xls and everytime I run the macro in entry.xls, it opens up the 02.09.2009.xls, which is my entry in a cell in extry.xls

    Please help.

    thanks.

    Baron

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
     
    Option Explicit
    Sub OpenExcelFile()
    On Error GoTo 1
    ActiveWorkbook.FollowHyperlink (ActiveWorkbook.Path & "\" & Range("B2") & ".xls"), NewWindow:=True
    Exit Sub
    1: MsgBox Err.Description
    End Sub
    the dated file has to be in the same directory as your entry.xls or change it in the code. Change range b2 to suit.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Regular
    Joined
    Jul 2008
    Posts
    12
    Location

    SOLVED

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •