Check Box help

  • Thread starter Thread starter Donkin
  • Start date Start date
D

Donkin

Hi

I have a macro which will input a default value into a cell when run
and I have assigned a check box to the macro.

What I want to do is - If the check box is checked the macro runs and
the default value is inserted (that bits OK).

Now what I want to do is if the user inputs there own value the check
box, unchecks itself to show the default has not been used.

All help appreciated.
 
Maybe you can use a worksheet_change event to look for a change to that cell.

I used a checkbox (named "check box 1") from the Forms toolbar and looked for a
change to A1:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Me.Range("a1"), Target) Is Nothing Then Exit Sub

Me.CheckBoxes("check box 1").Value = xlOff

End Sub

rightclick on the worksheet tab that should have this behavior. Select view
code. Paste this in.

Adjust the name/range accordingly.
 
Use the change event for the cell input. something like this

Right click on the sheet-tab name, view code, and enter following
code:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" Then

' keep only one line from the following
Range("B1") = False ' if you are using forms menu check
box
CheckBox1.Value = False ' if you are using Control Toolbox menu
check box

End If

End Sub


Where A1 is the input cell, B1 is the cell linked to your check box if
you have the Forms menu checkbox.

Mangesh
 
Back
Top