Sub ControlAddRowbyAry(tmpControl As object, tmpArray(,) As string, Optional PosX As Integer = 1)
Dim inty As integer
select case tmpcontrol
case isa ComboBox
combobox(tmpControl).DeleteAllRows
For intY = 0 To UBound(tmpArray, 2)
combobox(tmpcontrol).addrow tmpArray(0, intY)
combobox(tmpControl).RowTag(combobox(tmpControl).listcount-1)= tmpArray(PosX, intY)
Next
case isa popupmenu
popupmenu(tmpControl).DeleteAllRows
For intY = 0 To UBound(tmpArray, 2)
popupmenu(tmpcontrol).addrow tmpArray(0, intY)
popupmenu(tmpControl).RowTag(popupmenu(tmpControl).listcount-1)= tmpArray(PosX, intY)
Next
end select
End Sub