Automatically update cell.value as long as a ActiveX checkbox is checked - excel 365 on WINDOWS

excel_lelkes

New Member
Joined
May 16, 2017
Messages
30
C2.value is updated when a button is clicked.
My wish is that so long cbox1 is checked O17.value = C2.value

Code:
Private Sub cbox1_Click()
If Me.cbox1.onValue = True Then
       Sheet1.Range("O17").Value = Sheet1.Range("C2").Value
End If


End Sub
With this code I need everytime click the checkbox

Please help me with a code that updates O17.Value automatically. I hope I could explain so you can understand what I want to do....


Thanks in advance for your help and time
Peter from Sweden, using Excel-365 on Windows
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hello,

Have you set a cell link for your ActiveX checkbox ... ?
 
Upvote 0
Say you have selected cell A1 as your LinkedCell for your ActiveX checkBox ...

In cell O17, you could have following formula:

=IF(A1,C2,"")

Hope this will help
 
Upvote 0
Thanks for your answer James!
I didn´t know that I have to do that. I don´t know how, so now I'll google it and try

Regards
Peter
 
Upvote 0
Thanks for your answer James!
I didn´t know that I have to do that. I don´t know how, so now I'll google it and try

Regards
Peter
I hope I didn´t offended you James, but for med the best way to learn, is to understand! That's why I want to google so I can learn;):eek:
 
Upvote 0
With James tips on
linked cell
, I have solved the problem as follows:
  • 4 checkboxes linked to A10, A11, A12, and A13
  • this code
    Code:
    Sub resultQ()If Sheet1.Range("A10").Value = True And Sheet1.Range("A11").Value = False And Sheet1.Range("A12").Value = False And Sheet1.Range("A13").Value = False Then
           Sheet1.Range("O17").Value = Sheet1.Range("C2").Value
    ElseIf Sheet1.Range("A10").Value = True And Sheet1.Range("A11").Value = True And Sheet1.Range("A12").Value = False And Sheet1.Range("A13").Value = False Then
           Sheet1.Range("O18").Value = Sheet1.Range("C2").Value - Sheet1.Range("O17").Value
    ElseIf Sheet1.Range("A10").Value = True And Sheet1.Range("A11").Value = True And Sheet1.Range("A12").Value = True And Sheet1.Range("A13").Value = False Then
           Sheet1.Range("O19").Value = Sheet1.Range("C2").Value - (Sheet1.Range("O17").Value + Sheet1.Range("O18").Value)
    ElseIf Sheet1.Range("A10").Value = True And Sheet1.Range("A11").Value = True And Sheet1.Range("A12").Value = True And Sheet1.Range("A13").Value = True Then
           Sheet1.Range("O20").Value = Sheet1.Range("C2").Value - (Sheet1.Range("O17").Value + Sheet1.Range("O18").Value + Sheet1.Range("O19").Value)
    
    
    End If
    End Sub



  • worsheet change event:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
       Call resultQ
End Sub

It's maybe not the most elegant solution, but it works for me, at least localt on my computer....

Regards
Peter
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top