Copy data from all files in a folder individually.

MichaelM62

New Member
Joined
Oct 18, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am working on a conversion tool to convert an old style form to a new style form.

I have the converter working to the point where I copy the data from the old file by hand and then paste it into the form and it saves the new style form automatically.

I would like it if my code could be updated so it copies the data between A4 and P2500 from the first file in my folder, paste it into the "INPUT" tab starting at A4 on my conversion sheet, save the converted file (as it currently does), then clears the data that was pasted and repeats with the next file in my folder.

Current VBA:

Private Sub CommandButton1_Click()

Dim rng As Range
Set rng = Range("N21")
Worksheets(Array("Parent Equipment", "Child Components")).Copy
Worksheets("Parent Equipment").UsedRange.Value = Worksheets("Parent Equipment").UsedRange.Value
Worksheets("Child Components").UsedRange.Value = Worksheets("Child Components").UsedRange.Value
ActiveWorkbook.SaveAs rng
End Sub


'VBA Create New Workbook (Excel File)'
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

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