View Full Version : [SOLVED:] Opening another file with title equal to a cell entry
baron11
03-09-2009, 02:45 PM
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
lucas
03-09-2009, 03:11 PM
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.
baron11
03-12-2009, 01:58 PM
Thanks.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.