PDA

View Full Version : UF Case Mutliple values in cell



Emoncada
05-28-2010, 08:36 AM
I have 6 Checkboxes.

Chkbox1, Chkbox2, ...- Chkbox6.

Each has a Caption of it's own number.
So Chkbox1.Caption = "1", Chkbox2.Caption = "2"

What I would like is transfer the True values of the chkboxes to one cell seperated by a ",".

So If chkBox1 & chkBox6 is True Then Range("H6").value = "1,6"

Bob Phillips
05-28-2010, 09:34 AM
What sort of checkboxes?

Emoncada
05-28-2010, 09:35 AM
They are UserForm CheckBoxes

Bob Phillips
05-28-2010, 09:42 AM
Dim i As Long
Dim tmp As String
For i = 1 To 6

If Me.Controls("ChkBox" & i).Value Then

tmp = tmp & i & ","
End If
Next i

Range("H6").Value2 = Left$(tmp, Len(tmp) - 1)

Emoncada
05-28-2010, 10:43 AM
It Worked Thanks