S
shirley
i want to change the color of my excel data when the default save butto
is clicked. how do i do so? i also want to change the color of my dat
just before the workbook is closed. how shld i do it? i have the cod
below, but they do not work.
Sub Workbook_beforeClose()
Dim Msg, Style, Title, Response
Msg = "Are you sure you want to exit? No changes are allowed afte
closing of the workbook."
Style = vbYesNo + vbQuestion
Title = "Important!"
If MsgBox(Msg, Style, Title) = vbYes Then
save
Else: End If
End Sub
Private Sub save()
If ThisWorkbook.save = True Then
ActiveSheet.Unprotect password:="1234"
ActiveSheet.Cells.Font.Color = RGB(0, 0, 0)
ActiveSheet.Cells.EntireRow.Locked = True
ThisWorkbook.save = True
ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
password:="1234"
Else: End If
End Su
is clicked. how do i do so? i also want to change the color of my dat
just before the workbook is closed. how shld i do it? i have the cod
below, but they do not work.
Sub Workbook_beforeClose()
Dim Msg, Style, Title, Response
Msg = "Are you sure you want to exit? No changes are allowed afte
closing of the workbook."
Style = vbYesNo + vbQuestion
Title = "Important!"
If MsgBox(Msg, Style, Title) = vbYes Then
save
Else: End If
End Sub
Private Sub save()
If ThisWorkbook.save = True Then
ActiveSheet.Unprotect password:="1234"
ActiveSheet.Cells.Font.Color = RGB(0, 0, 0)
ActiveSheet.Cells.EntireRow.Locked = True
ThisWorkbook.save = True
ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
password:="1234"
Else: End If
End Su