batch row insert /specific cell update

spootnic

New Member
Joined
Jan 15, 2014
Messages
3
I have 80 excel files in a folder. The structure of each file is the same meaning beside the file name which us different, the file content is a table which is identical in all files. The files have the same amount of rows and columns. Column headers are same. Column a is the date column. Every row is a working day date (never a date corresponding to a saturday or Sunday).
Cell a2 (first row in file) in all files corresponds to most recent date in the file.

My challenge:
Sometimes or somedays, I need to insert a new row above positions '2', copy the entire row now shifted to position 3 and paste it into the newly inserted row.BUT, I also must update the date in the newly inserted row at a2 with a3.date +next_business_day.



How can I do this across the entire set of files I have my folder? Macros, code, your suggestions much appreciated.

Thanks
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Rich (BB code):
Sub Open_My_Files()
Dim MyFile As String
With Application
    .Calculation = xlCalculationManual
End With
MyPath = "C:\Users\Owner\Documents\ExcelChest\Combo\" 'Change Path
MyFile = Dir(MyPath)

Do While MyFile <> ""
If MyFile Like "*.xlsx" Then
Workbooks.Open MyPath & MyFile
Rows("2:2").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove 'This inserts new row - not totally sure about this line...

' enter here the code to do the individual tweeking you wish done (It's not clear to me from what you say...)..

ActiveWorkbook.Close True
End If
MyFile = Dir
Loop
With Application
    .Calculation = xlCalculationAutomatic
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,484
Messages
6,125,066
Members
449,206
Latest member
Healthydogs

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