View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Use checkbox to toggle between formula and manual input


-----Original Message-----
pac,

Thanks for the response. It works to some extent. Still
some problem (design problem really). When the check

box
is clicked, the formula is reinstated

Isn't that what you want?



Sorry for being unclear. The problem is when I check the
check box, first defaultOpt kicks in and change the cell
back to formula. But...

The result of this change will trigger the
Worksheet_Change procedure, which switch the checkbox back
to uncheck.

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
-----------------



-