Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 852
Default Check box linked cell = TRUE then J5 valued reduced by 1

Each time the check box is checked and linked cell D5 returns TRUE, what formula can I use to reduce the value in J5 by 1.

I tried using J1 as the begining value of say 10 but can't figure the formula in J5 to return 1 less each time D5 rings TRUE.

Tried a Select Case in a change event macro but the range/target AND the "TRUE"/value I could not get to work.

There will be several D cells with check box linked cells and the same amount of J values to be reduced as their respective D cell ring up a "TRUE".

Howard



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Check box linked cell = TRUE then J5 valued reduced by 1

Each time the check box is checked and linked cell D5 returns TRUE,
what formula can I use to reduce the value in J5 by 1.

I tried using J1 as the begining value of say 10 but can't figure the
formula in J5 to return 1 less each time D5 rings TRUE.

Tried a Select Case in a change event macro but the range/target AND
the "TRUE"/value I could not get to work.

There will be several D cells with check box linked cells and the
same amount of J values to be reduced as their respective D cell ring
up a "TRUE".

Howard


Did you try using a macro assigned to the checkboxes?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 852
Default Check box linked cell = TRUE then J5 valued reduced by 1


Howard


Did you try using a macro assigned to the checkboxes?

--
Garry



Aha! I was able to make this work

Sub CheckBox2_Click()
If ThisWorkbook.Worksheets(1).Shapes("Check Box 2").OLEFormat.Object.Value = 1 Then
Range("J5").Value = Range("J5").Value - 1
End If
End Sub

Thanks for hint.

Howard

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Check box linked cell = TRUE then J5 valued reduced by 1


Howard


Did you try using a macro assigned to the checkboxes?

--
Garry



Aha! I was able to make this work

Sub CheckBox2_Click()
If ThisWorkbook.Worksheets(1).Shapes("Check Box
2").OLEFormat.Object.Value = 1 Then Range("J5").Value =
Range("J5").Value - 1 End If
End Sub

Thanks for hint.

Howard


Congrats, but that approach requires each control to have its own sub.
If you use an ActiveX control you can assign an index to its Tag
property. Then all can use the same routine. You can also assign a
GroupName to context-specific controls, for example, in different
sections of a form.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 852
Default Check box linked cell = TRUE then J5 valued reduced by 1



Congrats, but that approach requires each control to have its own sub.
If you use an ActiveX control you can assign an index to its Tag
property. Then all can use the same routine. You can also assign a
GroupName to context-specific controls, for example, in different
sections of a form.

--
Garry

Hmmm, don't know if it is a Form or an ActiveX. My testing is with a Forms of course.

I'll take a look at the ActiveX and see if I can 'ciffer what its Tag property is etc.

Howard


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default Check box linked cell = TRUE then J5 valued reduced by 1

Oops.., forgot there's no Tag prop for this control!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 852
Default Check box linked cell = TRUE then J5 valued reduced by 1

On Thursday, March 12, 2015 at 11:00:27 PM UTC-7, GS wrote:
Oops.., forgot there's no Tag prop for this control!

--
Garry


Just poking about, I put an activex check box on the sheet.

It came up numbered 22, don't know why as this is a new unused workbook...? Would have thought it would be 1.

With the code here, it errors out on this line:

Set cb = ActiveSheet.Shapes("Check Box 22")

With "Name not found"

Or with this as the name same as in the Property window, errors:

Set cb = ActiveSheet.Shapes("CheckBox22")

Does not support that Property or Method



Private Sub CheckBox22_Click()
Dim cb As Shape

Set cb = ActiveSheet.Shapes("Check Box 22")

If cb.OLEFormat.Object.Value = 1 Then
MsgBox "Checkbox is Checked"
Else
MsgBox "Checkbox is not Checked"
End If
End Sub

Now I remember why I use Forms.<g

Howard
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
Code to display a true or false value in the cell containing a check box Dave K Excel Programming 1 August 26th 10 06:25 PM
Check Box linked cell offset Tracey Excel Programming 1 February 8th 10 08:59 AM
check box linked cell ranswert Excel Programming 5 March 26th 08 11:41 PM
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
How to know the linked cell of a check box gm139[_2_] Excel Programming 3 February 5th 06 03:33 PM


All times are GMT +1. The time now is 02:36 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"