ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating one cell using multiple checkboxes (https://www.excelbanter.com/excel-programming/426053-populating-one-cell-using-multiple-checkboxes.html)

A#'s

Populating one cell using multiple checkboxes
 
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.

Jacob Skaria

Populating one cell using multiple checkboxes
 
Cells(1,1) = CheckBox1.Value & "," & CheckBox2.Value & "," & CheckBox3.Value

If this post helps click Yes
---------------
Jacob Skaria


"A#'s" wrote:

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.


A#''''s

Populating one cell using multiple checkboxes
 
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.

"Jacob Skaria" wrote:

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

If this post helps click Yes
---------------
Jacob Skaria


"A#'s" wrote:

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.


Jacob Skaria

Populating one cell using multiple checkboxes
 
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
---------------
Jacob Skaria


"A#''''s" wrote:

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.

"Jacob Skaria" wrote:

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

If this post helps click Yes
---------------
Jacob Skaria


"A#'s" wrote:

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.



All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com