Good Day,
I wanted to write a code for the user to open a file in specific destinations and choose excel file among them. then do all necessary copy and paste things. I found a code here and altered a bit for my use. It works fine. But my problem is it kept on displaying update links message. I tried to avoid by using
but could not manage.
Anyone would like to give me a hand?
Thank you very much
Cheers Baha
I wanted to write a code for the user to open a file in specific destinations and choose excel file among them. then do all necessary copy and paste things. I found a code here and altered a bit for my use. It works fine. But my problem is it kept on displaying update links message. I tried to avoid by using
Code:
UpdateLinks:=0
Anyone would like to give me a hand?
Thank you very much
Cheers Baha
Code:
Sub OpenFileCopyRange()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
ChDrive "G:"
ChDir "G:\Sales\EOD Reports\Top 20 Daily\"
Set sh = ThisWorkbook.Sheets("T20 SCL")
Set sh2 = ThisWorkbook.Sheets("Sds T20")
Set sh3 = ThisWorkbook.Sheets("Vn T20")
Set sh4 = ThisWorkbook.Sheets("Pla T20")
Set sh5 = ThisWorkbook.Sheets("SC T20")
Set sh6 = ThisWorkbook.Sheets("Par T20")
Filename = Application.GetOpenFilename("Excel files (*.xls*), *.xls*", UpdateLinks:=0, Title:="Please select a file that you would export the report from")
If Filename <> False Then
Workbooks.Open (Filename)
Sheets("Top 20").UsedRange.Copy sh.Range("A1:V74")
Sheets("Snd").UsedRange.Copy sh2.Range("A1:V74")
Sheets("Ven").UsedRange.Copy sh3.Range("A1:V74")
Sheets("Plaz").UsedRange.Copy sh4.Range("A1:V74")
Sheets("SC").UsedRange.Copy sh5.Range("A1:V74")
Sheets("Par").UsedRange.Copy sh6.Range("A1:V74")
ActiveWorkbook.Close
Else
Exit Sub
End If
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Last edited: