Hello Experts,
My macro starts off with the following commands to open a file based on
the combined input of 2 cells called "filename" (ie. C:\My
Documents\)and "filelocation" (ie. Data.xls). How do I alter this so
that if the file is already opened, then switch to that opened workbook
(as I need to copy and paste the data back to the current worksheet)?
Dim fName As String
Dim Wkbk As Workbook
Dim curWks As Worksheet
Set curWks = ActiveSheet
fName = Worksheets("Sheet1").Range("filename").Value
Set Wkbk = Workbooks.Open(Range("filelocation") & fName,
UpdateLinks:=0)
Thanks in advance,
Ricky
*** Sent via Developersdex http://www.developersdex.com ***
Bookmarks