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
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()
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: