I have coded my Userform to dynamically generate labels, textboxes and comboboxes depending on the number of data imported from the spreadsheet. I know i can format the combobox by change event but this does not seem to work on dynamically generated ones. Below is the code i use to generate the combobox:
Set cmbRTWO1 = Frame1.Controls.Add("Forms.ComboBox.1")
With cmbRTWO1
.Name = "cmbRTWO" & i
.Height = 18
.Width = 78
.Left = 456
.Top = 9 * i * 2 + 108
.Locked = False
.Value = cRos.Range("G" & 1 + i).Value
.TabStop = True
.RowSource = "StartDate"
.Font.Name = "Calibri"
.Font.Size = 10
End With
I was told that as a work around, i can also convert my rowsource first to string though i am not sure how i should go about doing that too.
Bookmarks