Macro - Insert Links in Multiple Cells to Multiple Workbooks

ElizS

New Member
Joined
Nov 2, 2016
Messages
4
I’m trying to create a macro to look through multiple workbooks that are daily logbooks and have the number in a particular cell from each work book be shown next to the date of the external workbook.

Each workbook follows the same naming convention of Year_Month_Day Shift Log and the data I need is in cell R76 of worksheet LogBook. E.g. the workbook from 6th May would be 2017_05_06 Shift Log.xlsm.

I’ve managed to find some code that gets me part way there but at the moment it only looks at specific cells to modify the external link and gives me the link I need. It doesn’t loop and then look at the next row/date and currently it gives me the link but ideally I would just want the number that the linked cell refers to.

There are hundreds of workbooks to be linked and future workbooks that haven’t even been created yet but I will need to find the data in future too.

Here is the code I’m currently working with:

Sub LogBookSearch()
'
Dim ThisDay As String
Dim ThisMonth As String
Dim ThisYear As String

ThisDay = Range("C2").Value
ThisMonth = Range("B2").Value
ThisYear = Range("A2").Value


With Range("D2")
.Formula = "='U:\[" & ThisYear & "_" & ThisMonth & "_" & ThisDay & " Shift Log.xlsm]LogBook'!$R$76"

End With

End Sub


Here is the workbook (simplified) I would like the data posted to (in the current macro D2 shows the linked figure but the macro posts it as a link rather than just the figure):

ABCD
1YearMonthDayLinked Data
220170505='U:\[2017_05_05 Shift Log.xlsm]LogBook'!$R$76
320170506
420170507
520170508
620170509
720170510

<tbody>
</tbody>


<tbody></tbody>

Any help to put me in the right direction of how to loop my marco to the next row and post the linked figure rather than the link itself would be greatly appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,215,220
Messages
6,123,693
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top