Repeat macro on multiple files

NickvdB

Board Regular
Joined
Apr 30, 2014
Messages
89
Office Version
  1. 365
Platform
  1. Windows
Hi,

Can anybody help me with the following?
I have like 50 files on sharepoint on multiple folders that have password protected sheets and the files are setup wise completely a copy from eachother. However already have content in some places I can't loose. To prevent every time doing for 50 files resolving of one error. I would like to have a macro in a separate file that would:
1) Open the first file from a certain list, see example,without updating linked files and ignoring warnings
2) For each file remove the password protection (e.g. PASSWORD) from sheet Other Costs
3) Change the formula in cell D4 to =1+1
4) Put password (e.g. PASSWORD) back on sheet Other Costs
5) Close the file after being done, since they are on sharepoint with autosave, it does not even ask me to save when I close the file
6) Repeat from first step with second file, third and so on till last
7) Message displayed "All files handled"

Reason for preferring file one by one, if one goes into error, I can at least see that the ones before were handled.

Example of list:
AB
1sharepoint.com\file1
2sharepoint.com\file2
3sharepoint.com\file3
4sharepoint.com\file4
5sharepoint.com\file5
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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