Use checkbox to toggle between formula and manual input
pac,
This requires the use of undo: I will post the code tomorrow when I have
time.
Bernie
wrote in message
...
The question is, how do we modify Worksheet_Change to
ignore the change made by defaultOpt procedure.
Thanks,
pac
P.S I paste the two procedures back for your convenience.
---------------------
Private Sub defaultOpt_Click()
ActiveWorkbook.Worksheets("Model 2").Cells(15, 4).Resize
(14, 1).Formula = _
"=Actual FORMULA HERE, written for cell D15"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Cells(15, 4).Resize(14, 1)) Is
Nothing Then
Sheet1.defaultOpt.Value = False
End If
End Sub
-----------------
I guess I wanted to add a check statement if the content
of the cell is the same as the formula. But I am not sure
if the syntax is correct.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Cells(15, 4).Resize(14, 1)) Is
Nothing Then
If Cells(15,4).values Like "=FORMULA*" Then exit
Sheet1.defaultOpt.Value = False
End If
End Sub
|