Adding buttons to an excel spreadsheet.

Solved
VB_Code - Feb 5, 2024 at 11:39 PM
 RachelGreen - Feb 6, 2024 at 02:19 AM

Dear CCM Team,

How do you add a button on a particular cell in an excel spreadsheet to turn it on and off. Example: If I want to add a column of numbers, I want to be able to turn any cell on and off to either include or exclude the value in it.

Thanks,

Jim

Related:

1 response

Hi,

Try this:

Private Sub CheckBox1_Click() 'Replace "CheckBox1" with the actual checkbox name
If CheckBox1.Value = True Then Range("A1").Value = 0 'Replace "A1" with the cell you want to control
Else Range("A1").Value = OriginalValue 'Store the original value for later use
End If
End Sub
0