How to populate cell contents based on ActiveX checkbox?

Ayugma

New Member
Joined
Nov 20, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
Hi all, how would I populate a specific cell when a checkbox is checked? I tried the code below, but it doesnt change the cell value automatically. Any help would be appreciated.
VBA Code:
Private Sub CommandButton9_Click()
If CheckBox1.Value = True Then
    Range("A109").Value = "ZJ2"
ElseIf CheckBox1.Value = False Then
    Range("A109").ClearContents
    If CheckBox2.Value = True Then
    Range("A109").Value = "ZJ3"
ElseIf CheckBox2.Value = False Then
    Range("A109").ClearContents
End If
End If

End Sub
 
Never mind, I'm just getting confused. The code does what is intended. Thank you!
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You're welcome & thanks for the feedback.
 
Upvote 0
Sorry to reopen the thread again, but I was wondering how about autofilling one cell based on multiple checkbox inputs?
 
Upvote 0
You already have a thread running for that don't you?
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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