Creating Macro to open Link to excel sheet - copy data from specified cell and then paste into original sheet

SJTGM

New Member
Joined
Feb 16, 2018
Messages
1
Hi All,

I have been trying to create a Macro to copy data from a hyperlinked excel sheet, but have not had much luck.

Basically I have a master excel workbook with columns for different data. This data is populated manually from other excel workbooks which are of a standardised format and the data is always in the same cells. i receive multiple of these standardised workbooks every day and would like to automate the process of opening the file and copying the data into the master sheet. The data is always in the same Cells and i would be linking the standardised sheets from a local drive in the first Cell of each row.

E.g.
Header: Width Length Height
Data: 12cm 67cm 34cm

I am trying to create a Macro that, when run, clicks the link in the first cell (e.g. A1) to go to one of the standardised excel documents.

Once in this document, i want to copy the data from the specific cells and paste into the master sheet in the relevant columns.

I would like this to work relatively, so i can put a link in for each new standardised sheet i receive and run the macro to populate the adjacent columns.

Any assistance would be greatly appreciated

Thank you
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Code:
Sub CopyData()
Dim Lnk As Range
Set Lnk = Sheets("MasterSheet").Range("A1")
Do Until Lnk.Value = ""
    Lnk.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    'Do your stuff to pick data from here
    Set Lnk = Lnk.Offset(1, 0)
Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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