Question : reset cell to original value

IN the attached workbook I have the Master Weekly Pahting for an orerator and what I'n now trying to do is when the Interior.color is 9 the original value of the cell is retured and the intlerior.colour as set to 15

I've been able to set the colour but I have not bee able to set the cell value to is original .

For examlpe BG12 value should now be HP1_01 then when BK14 is blank it's original value is HP1_02

This is to happen when the Interior.colour is 9 only, and only foe HP1 and HP2
Attachments:
 
original cell value test
 

Answer : reset cell to original value

Public myValue, mAddress As String

Private Sub Worksheet_Change(ByVal Target As Range)
If MsgBox("Click Yes to revert to original value", vbYesNo) = vbYes Then
    If Target.Address = mAddress Then
        Application.EnableEvents = False
        Target.Value = myValue
        Application.EnableEvents = True
    End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
mAddress = Target.Address
myValue = Target.Value
End Sub
Random Solutions  
 
programming4us programming4us