ProteanBeing
03-13-2008, 10:42 AM
I am trying to create a form with a combo box. The code is as follows:
Dim ComboData()
Private Sub UserForm_Initialize()
counter = 0
For Each MaterialNumber In ThisWorkbook.Worksheets("Log").Range("A3:A60000")
If Not IsEmpty(MaterialNumber.Value) Then
ReDim Preserve ComboData(3, counter)
ComboData(0, counter) = MaterialNumber.Value
ComboData(1, counter) = MaterialNumber.Range("B1").Value
ComboData(2, counter) = MaterialNumber.Row
counter = counter + 1
End If
Next MaterialNumber
Me.ComboMaterial.Column() = ComboData
End Sub
When I try to run it I get a msgbox that reads: "Invalid Property Value"
When I click OK the combo box is correctly filled in.
When I close the form I get the same msgbox again.
Does anyone know how to make this go away?
Dim ComboData()
Private Sub UserForm_Initialize()
counter = 0
For Each MaterialNumber In ThisWorkbook.Worksheets("Log").Range("A3:A60000")
If Not IsEmpty(MaterialNumber.Value) Then
ReDim Preserve ComboData(3, counter)
ComboData(0, counter) = MaterialNumber.Value
ComboData(1, counter) = MaterialNumber.Range("B1").Value
ComboData(2, counter) = MaterialNumber.Row
counter = counter + 1
End If
Next MaterialNumber
Me.ComboMaterial.Column() = ComboData
End Sub
When I try to run it I get a msgbox that reads: "Invalid Property Value"
When I click OK the combo box is correctly filled in.
When I close the form I get the same msgbox again.
Does anyone know how to make this go away?