View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default HELP - Too long coding for Macro

Does anyone have any suggestions on how to solve the problem of having too
long coding for Macro? I don't want to split the coding into 2 macro
separately.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

Coding is shown as below:

Sub Temp()

Application.DisplayAlerts = False

Workbooks.Open Filename:="C:\File1.xls", UpdateLinks:=3
Workbooks("File1.xls").Close savechanges:=True

Workbooks.Open Filename:="C:\File2.xls", UpdateLinks:=3
Workbooks("File2.xls").Close savechanges:=True

Workbooks.Open Filename:="C:\File3.xls", UpdateLinks:=3
Workbooks("File3.xls").Close savechanges:=True

....

Workbooks.Open Filename:="C:\File1000.xls", UpdateLinks:=3
Workbooks("File1000.xls").Close savechanges:=True

Workbooks("UpdateFiles").Close savechanges:=True

End Sub