VBA: Opening multiple hyperlinks to excels and copying data to a consolidation excel file

snowcrash

New Member
Joined
Mar 1, 2018
Messages
10
Need
I have a file where in column “C” I have a list of different hyperlinks to excel workbooks stored on SharePoint (number of rows and links is different every month, but approx. 140). I want to retrieve information from these hyperlinks (the information needed is all in one range on a hidden sheet in the excel file) and paste into my central consolidation file on the same row as the hyperlink.

I have managed to write a simple script to retrieve the information from one file, however cheating as I name the file to use once the hyperlink has been opened on my test file.
I have applied screen refresh and display alerts to false, and once I have got the information from the file I don’t want to save once closed

I really need help to re-write this and understand how to loop this for undefined number of rows and hyperlinks

Code i currently have


Sub Consolidation()


Application.ScreenUpdating = False
Application.DisplayAlerts = False

Windows("centralConsolidation.xlsm").Activate
Range("C4").Hyperlinks(1).Follow


Windows("excelname.xlsm").Visible = True
Sheets("hiddensheet").Visible = True
Sheets("hiddensheet").Select
Range("B4:ADZ4").Select
Selection.Copy
Windows("centralConsolidation.xlsm").Activate
Range("F4").Select
ActiveSheet.Paste
Windows("excelname.xlsm").Activate
Sheets("hiddensheet").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.Close savechanges:=False

Windows("centralConsolidation.xlsm").Activate
Range("B2").Select

Application.DisplayAlerts = False
Application.ScreenUpdating = True

End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi All,

I keep trying to work out this out, but not gaining any ground

Is anyone able to help point me in the right direction to loop the above macro?

/Snowcrash
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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