HI Guys,
I have this macro currently to open a closed workbook and copy certain columns to active workbook then close. I would like the opening of the new workbook not to show up, and it must update as I have it. Although my macro does not work if filters are In place, can anyone help me add in clear filters? I also realise there is probably a better code for the Copying of different cells.... But not great with VBA.
Sub UpdateSheet()
Dim x As Workbook
Dim y As Workbook
Set x = Workbooks.Open("C:\Users\611231350\Desktop\FNDDL MASTER.xlsx", UpdateLinks:=1)
Set y = ThisWorkbook
x.Sheets("MASTER").Range("A:B").Copy
y.Sheets("DL MASTER").Range("A:B").PasteSpecial
x.Sheets("MASTER").Range("D:O").Copy
y.Sheets("DL MASTER").Range("D:O").PasteSpecialPaste:=xlPasteValues
x.Sheets("MASTER").Range("P:Q").Copy
y.Sheets("DL MASTER").Range("P:Q").PasteSpecial
x.Sheets("MASTER").Range("R:AC").Copy
y.Sheets("DL MASTER").Range("R:AC").PasteSpecialPaste:=xlPasteValues
Application.CutCopyMode = False
x.Close savechanges:=False
End Sub
I have this macro currently to open a closed workbook and copy certain columns to active workbook then close. I would like the opening of the new workbook not to show up, and it must update as I have it. Although my macro does not work if filters are In place, can anyone help me add in clear filters? I also realise there is probably a better code for the Copying of different cells.... But not great with VBA.
Sub UpdateSheet()
Dim x As Workbook
Dim y As Workbook
Set x = Workbooks.Open("C:\Users\611231350\Desktop\FNDDL MASTER.xlsx", UpdateLinks:=1)
Set y = ThisWorkbook
x.Sheets("MASTER").Range("A:B").Copy
y.Sheets("DL MASTER").Range("A:B").PasteSpecial
x.Sheets("MASTER").Range("D:O").Copy
y.Sheets("DL MASTER").Range("D:O").PasteSpecialPaste:=xlPasteValues
x.Sheets("MASTER").Range("P:Q").Copy
y.Sheets("DL MASTER").Range("P:Q").PasteSpecial
x.Sheets("MASTER").Range("R:AC").Copy
y.Sheets("DL MASTER").Range("R:AC").PasteSpecialPaste:=xlPasteValues
Application.CutCopyMode = False
x.Close savechanges:=False
End Sub