7
71paolo71
Dear friends
Someone can tell me why the code "wkbk.Close SaveChange:=False doesn'
work" in the macro below?
Is it possible to write the bklist in a different way (more short)?
Thanks in advance
Sub Unisce_file()
bkList = Array("C:\Documents an
Settings\donello\Desktop\MACRO\vendite.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\ordini.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\bdg.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\personale.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\mdc.xls")
For i = LBound(bkList) To UBound(bkList)
Set wkbk = Workbooks.Open(bkList(i))
If i = LBound(bkList) Then
wkbk.Sheets.Copy
Set wkbk1 = ActiveWorkbook
Else
wkbk.Sheets.Copy After:=wkbk1.Sheets(wkbk1.Sheets.Count)
End If
Next
wkbk1.SaveAs Filename:="C:\Documents an
Settings\donello\Desktop\MACRO\report.xls"
wkbk.Close SaveChange:=False
End Su
Someone can tell me why the code "wkbk.Close SaveChange:=False doesn'
work" in the macro below?
Is it possible to write the bklist in a different way (more short)?
Thanks in advance
Sub Unisce_file()
bkList = Array("C:\Documents an
Settings\donello\Desktop\MACRO\vendite.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\ordini.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\bdg.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\personale.xls", _
"C:\Documents and Settings\donello\Desktop\MACRO\mdc.xls")
For i = LBound(bkList) To UBound(bkList)
Set wkbk = Workbooks.Open(bkList(i))
If i = LBound(bkList) Then
wkbk.Sheets.Copy
Set wkbk1 = ActiveWorkbook
Else
wkbk.Sheets.Copy After:=wkbk1.Sheets(wkbk1.Sheets.Count)
End If
Next
wkbk1.SaveAs Filename:="C:\Documents an
Settings\donello\Desktop\MACRO\report.xls"
wkbk.Close SaveChange:=False
End Su