Individual checkbox selection

IoanZ

New Member
Joined
Mar 2, 2018
Messages
46
Hello

This VBA code helps me to do a individual check box selection
When I select first checkbox ,Cell O18 has value 1

When I select second checkbox (first checkbox became white..second is black), and Cell O18=0 an O19=1

Please tell me which are mofication for vba code wher I want to create this situation for 10..15 checkbox.

Link for the image: https://ibb.co/c61CGo

Sub Rett_Clic()
Dim Sheet1 As Object
Set Sheet1 = Sheets(1)
Application.ScreenUpdating = False
If Sheet1.Range("O18") = 0 Then
With Sheet1.Shapes("Rett 1").Fill
.ForeColor.SchemeColor = 8
.Visible = msoTrue
End With
With Sheet1.Shapes("Rett 2").Fill
.Solid
.Visible = msoFalse
End With
With Sheet1
Sheet1.Range("O18") = 1
Sheet1.Range("O19") = 0
End With
Else
With Sheet1.Shapes("Rett 1").Fill
.Solid
.Visible = msoFalse
End With
With Sheet1.Shapes("Rett 2").Fill
.ForeColor.SchemeColor = 8
.Visible = msoTrue
End With
With Sheet1
Sheet1.Range("O18") = 0
Sheet1.Range("O19") = 1
End With
End If
End Sub
 
Last edited:

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Watch MrExcel Video

Forum statistics

Threads
1,109,313
Messages
5,527,952
Members
409,794
Latest member
ajithppajith

This Week's Hot Topics

Top