Creating link to source workbook in VBA

Jakrae

New Member
Joined
Dec 5, 2018
Messages
1
Greetings community.

I'm very new here, and I am fairly new to VBA macros. I understand most of the basics, but I may need answers dumbed down a good bit. With that disclaimer out of the way, here is my questions.

Each customer has their own detailed checklist of processes (so separate workbooks for each customer), only the major points are sent to a single master list workbook as each section (instead of item) is completed . I want one of the rows to have a link back to the source workbook (or folder) that the data came from so I don't have to go to each individual customer folder to open the details, just click the link in the master list.

I was thinking that there's a way to reference back to "thisworkbook" (this is the one where the macro is stored, right?), but I have no idea how to make one of the cells made to a link back to the source workbook.

Here is my basic sloppy code without trying to add the links (file names and paths have been changed):

Code:
[INDENT]Sub Copy_Insert_3()[/INDENT]
[INDENT]'[/INDENT]
[INDENT]' Copy_Insert_3 Macro[/INDENT]
[INDENT]'[/INDENT]
[INDENT]Dim wb As Workbook[/INDENT]
[INDENT]Set wb = Workbooks.Open("X:\...MASTER LIST.xlsx")[/INDENT]
[INDENT]    Windows("MASTER LIST.xlsx").Activate[/INDENT]
[INDENT]    Rows("3:3").Select[/INDENT]
[INDENT]    Selection.Insert Shift:=xlDown[/INDENT]
[INDENT]    Windows("TASKS.xlsm").Activate[/INDENT]
[INDENT]    Sheets("Sheet2").Select[/INDENT]
[INDENT]    Rows("2:2").Select[/INDENT]
[INDENT]    Selection.Copy[/INDENT]
[INDENT]    Windows("MASTER LIST.xlsx").Activate[/INDENT]
[INDENT]    Rows("3:3").Select[/INDENT]
[INDENT]    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _[/INDENT]
[INDENT]        :=False, Transpose:=False[/INDENT]
[INDENT]    ActiveWorkbook.Save[/INDENT]
[INDENT]    Windows("TASKS.xlsm").Activate[/INDENT]
[INDENT]    Sheets("Sheet1").Select[/INDENT]
[INDENT]Workbooks("MASTER LIST.xlsx").Close SaveChanges:=True

 Windows("TASKS.xlsm").Activate[/INDENT]
[INDENT]End Sub[/INDENT]

I ran a few Google searches to no avail (might just be using the wrong terminology in my searches).

Thank you in advance for pointing me in the right direction! I'd like to learn how to do it more than simply have one of y'all do it.

Jakrae.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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