セルの変更の有無
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SavVal As Variant
If Target.Address <> "$A$1" Then Exit Sub
SavVal = Target.Value
Application.EnableEvents = False
Application.Undo
If SavVal = Target.Value Then
MsgBox "変っていません"
GoTo Owari
Else
MsgBox Target.Value & "→ " & SavVal & "に変更されました"
Target.Value = SavVal
End If
Owari:
Application.EnableEvents = True
End Sub
CSV 出力
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Sheets("Sheet1").Copy
ActiveWorkbook.SaveAs Filename:="D:\z_ntaka\test.csv", _
FileFormat:=xlCSV
ActiveWindow.Close
Application.DisplayAlerts = True
End Sub