Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default checkbox gets value not sets value

I think that I could get a checkbox to go out and do something after someone
checked it - But can I set the value of a checkbox based on the value in
some cell?

Example - I have a checkbox cleverly known as Checkbox 15;
I would like that checkbox to set itself to being checked when my user
places a value in the cell F26

doable? and how?

Users could set this checkbox themselves but always forget....thanks ahead
of time
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default checkbox gets value not sets value

On Wed, 27 Dec 2006 13:46:01 -0800, Marquel
wrote:

I think that I could get a checkbox to go out and do something after someone
checked it - But can I set the value of a checkbox based on the value in
some cell?

Example - I have a checkbox cleverly known as Checkbox 15;
I would like that checkbox to set itself to being checked when my user
places a value in the cell F26

doable? and how?

Users could set this checkbox themselves but always forget....thanks ahead
of time


Assuming that you're using the checkbox from the Control Toolbox
toolbar rather than the Forms toolbar, you can do it by using the
worksheet change event as follows (right click on the sheet tab and
select "View Code", then copy and paste this procedure into the module
that appears):

Private Sub Worksheet_Change(ByVal Target As Range)

Dim vnt As Variant

If Target.Address = "$F$26" Then

vnt = ""
'Just in case something weird happens in reading the value
On Error Resume Next
vnt = CStr(Target.Value)
On Error GoTo 0

If vnt = "" Then
Me.CheckBox15.Value = False
Else
Me.CheckBox15.Value = True
End If

End If

End Sub


---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
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
Hiding a ComboBox with a Checkbox AWeb Excel Worksheet Functions 2 September 15th 06 01:30 PM
Click event for checkbox from Forms toolbar Carolyn Excel Discussion (Misc queries) 6 September 11th 06 08:16 PM
Checkbox functionality Basia Excel Discussion (Misc queries) 2 June 19th 06 04:42 PM
Two data sets, one average SWeyer Charts and Charting in Excel 3 June 11th 05 04:07 PM
copy many CHECKBOX Taha Elian Excel Discussion (Misc queries) 1 April 28th 05 06:06 PM


All times are GMT +1. The time now is 04:50 PM.

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

About Us

"It's about Microsoft Excel"