#1   Report Post  
Donkin
 
Posts: n/a
Default 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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
mangesh_yadav
 
Posts: n/a
Default


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check box, so when you click on it it inserts a check mark into t. Steve Excel Discussion (Misc queries) 2 April 13th 05 09:12 PM
count check boxes Tony Excel Worksheet Functions 3 April 8th 05 03:48 AM
How do I use a check box to accept a calculation Joejoethecrackman Excel Discussion (Misc queries) 5 March 22nd 05 08:47 PM
Auto spell check as in word NC Excel Discussion (Misc queries) 2 January 27th 05 05:43 PM
Creating a check box that does not require security clearance. Maverick2U Excel Worksheet Functions 6 December 14th 04 02:46 AM


All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"