Macro that will take a row with formulas and paste them in each file

copleyr

Active Member
Joined
Aug 24, 2009
Messages
381
Hello all,

I have a row with formulas in each cell. I need a macro that can copy this row and paste it in a tab labeled "DEFAULTS" on row 70, in each excel file, in a desktop folder labeled "ALL".

I need the formulas to be authentic to each file (non-linked to other files).

Is this possible? I need this to be a macro because there are >200 of these excel files. Each file has the same tab labeled "DEFAULTS"

Thank you very much in advance.
 
Last edited:
It didn't like that one at all. It just kept looping on the same file and asking the same update links question
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I'm off to bed now, almost 1AM... See you later if no other helper comes up with a solution.
 
Upvote 0
So, without the parameter 2 it runs and asks once for every file in the loop, the question to update links or not.

With the parameter 2, you are asked the same question a number of times, for every file in the loop?

I do not follow this one I'm afraid. It should not ask anything at all with that parameter.
 
Upvote 0
With parameter 2, it asks the same question, for the first file, over and over again.

I'm unsure why. It's still a great macro though; I just have to sit here and keep pressing the "dont update" links button, 250 times :)
 
Upvote 0
Here is a similar program. Had the same situation where the "Application.DisplayAlerts = True" worked. Not sure if this could be of any help...




Code:
Sub Copy_dem_files()
Dim MyPathName As String
Dim MyFileName As String
Dim NumChars As Long
Dim X As Long
Dim SummarySheet As String
Workbooks.Add
SummarySheet = ActiveWorkbook.Name
MyPathName = "C:\Desktop\All/"
MyFileName = Dir(MyPathName)
X = 0
Do While MyFileName <> ""
    X = X + 1
    Workbooks.Open MyPathName & MyFileName, False
    Application.DisplayAlerts = False
    Sheets("Defaults").Range("A70:CO70").Copy
    Workbooks(SummarySheet).Activate
    Range("A" & X & ":CO" & X).PasteSpecial xlPasteValuesAndNumberFormats
    Range("A" & X & ":CO" & X).PasteSpecial xlPasteFormats
    Workbooks(MyFileName).Close False
    MyFileName = Dir
Application.DisplayAlerts = True
Loop
End Sub
 
Upvote 0
Can you email me a couple of input files? And also the file containing the code ("ThisWorkbook" in the VBA code)
 
Last edited:
Upvote 0
Hi there

I can reproduce the problem, I am asked 3 times per copy/paste operation (or transferring the formulas) or the origin of the sheets. That is:

- sheet Financial-Corp
- sheet Fin Review Team
- sheet Financial-GS

If I just add these sheets as empty sheets to the file with the code, and I "F2-Enter" all formulas in row 2, it works without asking.
Because now Excel can trace the origin of the sheets.

I do not know whether these 3 sheets in your file? Do you get the same question for updating for these 3 sheets?

Regards,

Wim
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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