|
▼りえ さん:
Main処理のみコード差し換えてください。
Sub ボタン1_Click()
Dim done1 As Boolean
Dim done2 As Boolean
Dim bkB As Workbook
Dim bkC As Workbook
Application.ScreenUpdating = False
Set bkB = Workbooks.Open("C:\東京\B.xls")
Set bkC = Workbooks.Open("C:\東京\C.xls")
'sheet1
done1 = Proc(bkC.Worksheets("Sheet1"), bkB.Worksheets("Sheet1"))
'sheet2
done2 = Proc(bkC.Worksheets("Sheet2"), bkB.Worksheets("Sheet2"))
bkB.Close SaveChanges:=False
If done1 Or done2 Then
Application.DisplayAlerts = False
bkC.SaveAs Filename:="\\サーバ名\フォルダ名1\共有フォルダ名2\" & bkC.Name
Application.DisplayAlerts = True
End If
bkC.Close SaveChanges:=False
Application.ScreenUpdating = True
If done1 Or done2 Then
MsgBox "終わりました"
Else
MsgBox "処理すべきデータがありませんでした"
End If
End Sub
|
|