Populating one cell using multiple checkboxes

A

A#'s

Hi,

I've created a userform with a number of check boxes. I'm trying to get the
text value of one or more checkboxes when selected returned to a single cell
on my worksheet using a comma as the seperator between each value.

Is it possible to have something on VBA to do that for me?

Thanks.
 
J

Jacob Skaria

Cells(1,1) = CheckBox1.Value & "," & CheckBox2.Value & "," & CheckBox3.Value

If this post helps click Yes
 
A

A#''''s

Thank you for your help but this didn't work the way i wanted. It returned
either "True" or "False" to the cell. I'm trying to get it to return the
values of the checkboxes that are True only while ignoring the false.

I thought i might need to use If ... Then statements.
 
J

Jacob Skaria

You can try this.
I am assuming you have named the checkboxes with a prefix 'chk'

Dim intTemp,strTemp
For intTemp = 1 to UserForm1.Controls.count
If Left(UserForm1.Controls(intTemp).name,3)= "chk" Then
strTemp = strTemp & "," chkValue.value
End If
Next


If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top