I'm looking to add a incremental number to a worksheet, but this is to be on an unsaveable workbook. I've used the following code for the unsavable workbook:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.Saved = True
Cancel = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
and I know I can use
Private Sub Worksheet_Activate() Range("A1") = Range("A1") + 1 Range("B1") = "times opened" 'customize RangeEnd Subto add an incremental number, but this code relies on the workbook being saved. Is there anyway to combine the two?</pre>
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.Saved = True
Cancel = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
and I know I can use
Private Sub Worksheet_Activate() Range("A1") = Range("A1") + 1 Range("B1") = "times opened" 'customize RangeEnd Subto add an incremental number, but this code relies on the workbook being saved. Is there anyway to combine the two?</pre>