My worksheet (WS) has examples in many of the field to assist user with what to put in each field, but part of my issue that I am now finding is when I put in numerical values. At first I had to change to white when print or save and visually that is great until you realize that those numbers were being added into the total numbers still. Clearly I could not have my examples numbers being added to a users numbers so I put in .Value = "0" ( see underlined below), but now when I save I can't get the code to run "change text to white" when I save the first time, it works if I hit save for a second time though. Is there any thoughts on how to zero out the cells I need without it triggering the Change WS? or let it trigger, but still change to white the first time anyone hits save?
-Aaron
Code:
Private Sub Workbook_BeforeSave(Cancel As Boolean)
If IsEmpty(Cells(35, 15)) Then 'if empty, put in "Value" and make value change text to white.
Cells(35, 15).Value = "3.411"
Cells(35, 15).Font.ColorIndex = 2
ElseIf Sheet1.Cells(35, 15).Value = "3.411" Then 'if equal to "Value", change text to white.
[U]Cells(35, 15).Value = "0"[/U]
Cells(35, 15).Font.ColorIndex = 2
ElseIf Sheet1.Cells(35, 15).Value <> "3.411" Then 'if text other than "Value", change text to black.
Cells(35, 15).Font.ColorIndex = 1
End If
End Sub
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Cells(35, 15)) Then 'if empty, put in "Value" and make value change text to teal.
Cells(35, 15).Value = "3.411"
Cells(35, 15).Font.ColorIndex = 14
ElseIf Sheet1.Cells(35, 15).Value = "3.411" Then 'if equal to "Value", change text to teal.
Cells(35, 15).Font.ColorIndex = 14
ElseIf Sheet1.Cells(35, 15).Value <> "3.411" Then 'if text other than "Value", change text to black.
Cells(35, 15).Font.ColorIndex = 1
End If
End Sub
-Aaron