I created a summary worksheet but now I need the data in a new file. This file would get updated each time the original is modified.
I have the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "O16" And Target.Value <> "" Then
Application.EnableEvents = False
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Range("O16").Value
Application.EnableEvents = True
End If
If Target.Address(False, False) = "AH2" And Target.Value <> "" Then
Application.EnableEvents = False
Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Range("M22").Value
Application.EnableEvents = True
End If
This works great but I need the code to open a summary workbook, post the data, save it and close.
The original file is never saved.
I have the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "O16" And Target.Value <> "" Then
Application.EnableEvents = False
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Range("O16").Value
Application.EnableEvents = True
End If
If Target.Address(False, False) = "AH2" And Target.Value <> "" Then
Application.EnableEvents = False
Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Range("M22").Value
Application.EnableEvents = True
End If
This works great but I need the code to open a summary workbook, post the data, save it and close.
The original file is never saved.