How can run this macro in all excell files in specific folder

bigmak

New Member
Joined
Sep 8, 2020
Messages
16
Office Version
  1. 2016
Platform
  1. Windows
Hello everybody

how can run this vba code in all excell file in folder ??
this code copy some info from Book4 to Book1 .
i have 5 excell file in a folder and i want this code run in all 5 excell file same time.

VBA Code:
Sub Macro3()
    Windows("Book4.xlsm").Activate
    Range("G5:G7").Select
    Selection.Copy
    Windows("Book1.xlsm").Activate
    Range("C13").Select
    ActiveSheet.Paste
End Sub
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
What sheet in Book4 holds the data you want to copy?
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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