D DWM New Member May 14, 2013 #1 I have a workbook with the file directories and names in cells C46, C48 C50 etc. These are currently added as hyperlinks. I would like to set up a macro/button to open all the files. The file names will change over time.
I have a workbook with the file directories and names in cells C46, C48 C50 etc. These are currently added as hyperlinks. I would like to set up a macro/button to open all the files. The file names will change over time.
Hui Excel Ninja Staff member May 14, 2013 #2 DWM How about this monster: [pre] Code: Sub OpenMyFiles() Dim c As Range For Each c In Range("c48:c58") If c.Text <> "" Then Workbooks.Open Filename:=c.Text Next End Sub [/pre] To use it: Open your file Goto VBA AltF11 Insert a new Code Module Paste the code into the code module Save the file as a Macro Enabled File *.xlsm Link the macro to a Button or Shape etc
DWM How about this monster: [pre] Code: Sub OpenMyFiles() Dim c As Range For Each c In Range("c48:c58") If c.Text <> "" Then Workbooks.Open Filename:=c.Text Next End Sub [/pre] To use it: Open your file Goto VBA AltF11 Insert a new Code Module Paste the code into the code module Save the file as a Macro Enabled File *.xlsm Link the macro to a Button or Shape etc
D DWM New Member May 14, 2013 #3 Looks good. I just need to change my cell data as it ios also used for lookups/sumifs with the ' on the front. Hence the hyperlinks. Thanks
Looks good. I just need to change my cell data as it ios also used for lookups/sumifs with the ' on the front. Hence the hyperlinks. Thanks