Possible duplicate:
Adding items to a multi-column list
MFC VC ++ has two controls, ListBox and ListCtrl . But with VBA, it seems that we only have a ListBox .
I want to create a list with two columns (Company_ID, Company_Name).
Here is what I tried:
- I created lstbox (ListBox control type)
- String source type = list of values
- I take the value from the user from two edit fields, and when the user clicks "add", he should be added to the list with two columns.
In the VBA code procedure, I added the following lines:
lstbox.ColumnCount = 2 lstbox.AddItem (Company_ID)
The following code does not work, which is similar to adding a column value:
lstbox.Column(1,lstbox.ListCount - 1) = Company_name
This gives an error:
Runtime "424" is required.
Can anyone help with vba code to add multi-column columns to the list.
Jignesh makwana
source share