Jump to content

Combo Box Poluation


Recommended Posts

Hi to all,

it seem very simple but I'm no able to solve this issue:


I want to populate a ComboBox by the data incoming from a multidimensional array (4 columns by n rows) created by results of selecting block attributes inside a drawing.

Private Sub UserForm_Activate()
Set oBlock = ThisDrawing.ActiveLayout.Block
I = 0
ReDim Preserve MyArr(3, I)
MyArr(0, I) = "GS_INTCODE"
MyArr(1, I) = "GS_Origine X"
MyArr(2, I) = "GS_Origine Y"
MyArr(3, I) = "GS_Origine Z"
CercaCodiceGLASS.ListaCodiciGlass.List = MyArr

I = 1
       For ICount = 0 To oBlock.Count - 1
           Set oEnt = oBlock.Item(ICount)
                If TypeOf oEnt Is McadPartReference Then
                    Set oblkRef = oEnt
                    DATA = oblkRef.DATA
                    For IntCode = LBound(DATA) To UBound(DATA)
                        If DATA(IntCode, 0) = "INTERNAL_CODE" Then
                            GS_INTCODE = DATA(IntCode, 1)
                            GS_Origine = oblkRef.Origin
                            ReDim Preserve MyArr(3, I)
                            MyArr(0, I) = GS_INTCODE
                            MyArr(1, I) = GS_Origine(0)
                            MyArr(2, I) = GS_Origine(1)
                            MyArr(3, I) = GS_Origine(2)
                         I = I + 1
                        End If
                    Next IntCode
                 End If
        Next ICount
With ListaCodiciGlass
.List() = MyArr
End With

CercaCodiceGLASS.ListaCodiciGlass.ListIndex = 1
End Sub

CercaCodiceGLASS it's the userformName

ListaCodiciGlass it's the name of combobox to popolate.

Combobox it's composed by four columns.

The result is the polulation of combobox with just few data instead all data inside the array that are hundred (see picuture below)



As second issue I'm not able to insert combobox column header. If you look at the picture seems there is a row header not a columns header.

Thank you everybody for support.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...