data load by checkbox label name

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,286
Office Version
  1. 2013
Platform
  1. Windows
Code:
Private Sub CheckBox1_Click()
 Dim i As Integer
    For i = 2 To 10
        Me.Controls("CheckBox" & i).Value = CheckBox1.Value
    Next i
End Sub

Good Day,
How can i send the checkbox labled names to the column"b' automaticly when they are selected?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Code:
Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then
Cells(1, 1).Value = CheckBox1.Caption
Else
Cells(1, 1).Value = ""
End If
If CheckBox2.Value = True Then
Cells(2, 1).Value = CheckBox2.Caption
Else
Cells(2, 1).Value = ""
End If
If CheckBox3.Value = True Then
Cells(3, 1).Value = CheckBox3.Caption
Else
Cells(3, 1).Value = ""
End If
If CheckBox4.Value = True Then
Cells(4, 1).Value = CheckBox4.Caption
Else
Cells(4, 1).Value = ""
End If
If CheckBox5.Value = True Then
Cells(5, 1).Value = CheckBox5.Caption
Else
Cells(5, 1).Value = ""
End If

End Sub

I just found out like that, but still wondering is there any easy way to do?
And also when the userform re opened the checked boxes having unchecked itself...how can i fix it?
Cheers
 
Upvote 0

Forum statistics

Threads
1,224,617
Messages
6,179,914
Members
452,949
Latest member
beartooth91

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