Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Check Box help
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. -- Donkin ------------------------------------------------------------------------ Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715 View this thread: http://www.excelforum.com/showthread...hreadid=373897 |
#2
|
|||
|
|||
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. Donkin wrote: 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. -- Donkin ------------------------------------------------------------------------ Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715 View this thread: http://www.excelforum.com/showthread...hreadid=373897 -- Dave Peterson |
#3
|
|||
|
|||
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 -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=373897 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
check box, so when you click on it it inserts a check mark into t. | Excel Discussion (Misc queries) | |||
count check boxes | Excel Worksheet Functions | |||
How do I use a check box to accept a calculation | Excel Discussion (Misc queries) | |||
Auto spell check as in word | Excel Discussion (Misc queries) | |||
Creating a check box that does not require security clearance. | Excel Worksheet Functions |