Adam Elsheimer
asked on
Merge wbs to Master wb - Control the startup message about updating linked workbooks and copy only values not formulas
I have to copy data wbs to a master wb. The simple macro below works fine.
Q1: First, in the Data wbs there are links to another wbs. I don't know how to control the startup message about updating linked workbooks in Excel when I run the macro. I have changed the Excel Options to avoid the message but no better result. How can I change the macro that it copies from closed data wbs?
Q2: Second, I would like copy only the values, no formulars to the master wb.
Thank you.
Regards,
Adam
Source
Q1: First, in the Data wbs there are links to another wbs. I don't know how to control the startup message about updating linked workbooks in Excel when I run the macro. I have changed the Excel Options to avoid the message but no better result. How can I change the macro that it copies from closed data wbs?
Q2: Second, I would like copy only the values, no formulars to the master wb.
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Sub simpleXlsMerger()
Dim bookList As Workbook
Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
Application.ScreenUpdating = False
Set mergeObj = CreateObject("Scripting.FileSystemObject")
'change folder path of excel files here
Set dirObj = mergeObj.Getfolder("C:\Users\Adam\Desktop\Verbundaktion\")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
Range("A3:IV" & Range("A65536").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
Thank you.
Regards,
Adam
Source
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry Adam this is different issue, I need to write new code.
ASKER
Shums, many thanks for your very fast and uncomplicated help.
Regards,
Adam
Regards,
Adam
You're Welcome Adam! Please to help.
Please try below:
Open in new window