K
Kiba
This is my code the part surronded by <<>> is where it errors at.
_________________________________________________________
Private SaveValue
Private Sub Worksheet_Activate()
SaveValue = ActiveCell.Range
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Static Mech As Boolean
<< If SaveValue = "" Then Exit Sub>>
If Mech = True Then
Mech = False
Exit Sub
End If
If MsgBox("Are you sure you want to change that value?", vbYesNo) = vbNo
Then
Mech = True
Target.Value = SaveValue
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
SaveValue = Target.Value
End Sub
________________________________________________
I get an error message when I highlight several cells and press delete. Or
if the cell contains a formula.
_________________________________________________________
Private SaveValue
Private Sub Worksheet_Activate()
SaveValue = ActiveCell.Range
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Static Mech As Boolean
<< If SaveValue = "" Then Exit Sub>>
If Mech = True Then
Mech = False
Exit Sub
End If
If MsgBox("Are you sure you want to change that value?", vbYesNo) = vbNo
Then
Mech = True
Target.Value = SaveValue
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
SaveValue = Target.Value
End Sub
________________________________________________
I get an error message when I highlight several cells and press delete. Or
if the cell contains a formula.