snowdyce
07-17-2014, 07:56 AM
I have some code in the ThisWorkbook section that runs when the workbook is saved. The code is simple, copies a value from one cell to another. It was working fine, but lately I am getting the Run time error '1004'. Bewlo if the code, the Debug hits the first one.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'On Save, copy Contex members from Sheet 1 to Sheet 2
Worksheets("Sheet2").Cells(6, 4).Value = Worksheets("Sheet1").Cells(6, 4).Value
Worksheets("Sheet2").Cells(7, 4).Value = Worksheets("Sheet1").Cells(7, 4).Value
End Sub
Thanks!
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'On Save, copy Contex members from Sheet 1 to Sheet 2
Worksheets("Sheet2").Cells(6, 4).Value = Worksheets("Sheet1").Cells(6, 4).Value
Worksheets("Sheet2").Cells(7, 4).Value = Worksheets("Sheet1").Cells(7, 4).Value
End Sub
Thanks!