the value in column B is 1. So I have a userform with a textbox that I'm checking to see if
Book1.xlsm
In the textbox (TextBox1) on UserForm 1 I would like to be able to show the following in this case: a, c, e, g
but I want to be able to have it work in case all values of column B are 1 such as: a, b, c, d, e, f, g, h
Can this be done? I think I'm lacking the programming knowledge to see past this one. Any help would be greatly appreciated. I have attached the file above for sample in what I'm trying to do.
Here is the code I have so far. I want the values to be in the textbox upon the form opening.
Private Sub UserForm1_Initialize()
Dim myarray As Variant
myarray = Array(1, 8)
For i = 1 To 8
If ThisWorkbook.Sheets("Sheet1").Cells(i, 2).Value = 1 Then
myarray(i) = ThisWorkbook.Sheets("Sheet1").Cells(i, 1).Value
Me.TextBox1.Text = myarray(0) + ", " + myarray(1) + ", " + myarray(2) ' + ... etc. just continuing what I would assume should go here but I know I'm missing something
End Sub
Please help, thanks to all again!!!
Bookmarks