BettyBoop0916
New Member
- Joined
- May 20, 2011
- Messages
- 16
Hi there,
I have a vba, that when a certain phrase is selected from a drop-down list in column A, a macro is triggered. My only issue is if I make a mistake, and I select that phrase by accident, how do I reverse the macro without having to unlock the sheet, and deleting the cells.
This is my vba code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 And Target.Value = "(5675) Gas & Oil - Regina" Then
Application.EnableEvents = False
Call GasAndOil
Application.EnableEvents = True
End If
End Sub
Can someone help with this?
I have a vba, that when a certain phrase is selected from a drop-down list in column A, a macro is triggered. My only issue is if I make a mistake, and I select that phrase by accident, how do I reverse the macro without having to unlock the sheet, and deleting the cells.
This is my vba code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 And Target.Value = "(5675) Gas & Oil - Regina" Then
Application.EnableEvents = False
Call GasAndOil
Application.EnableEvents = True
End If
End Sub
Can someone help with this?