I have seen many posts about this error message but all seem to have different causes and solutions. Mine happens randomly, it's used to happen over a year ago and then stopped and has randomly started up again, ie sometimes the macro works without fault and other times it does't.
Code:
Option Explicit
Private Sub WORKBOOK_BEFORESAVE(ByVal SAVEASUI As Boolean, Cancel As Boolean)
Application.ScreenUpdating = False
Worksheets("Millionaires").Activate
Range("C6:V842").Select
Selection.Sort Key1:=Range("D6"), Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("C2").Select
Selection.ClearContents
ActiveWorkbook.ResetColors
ActiveWorkbook.Colors(52) = RGB(255, 128, 128)
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: