Hi,
I am trying to load a multicolumn combobox with the following code
As you would see I am loading columns 1,3,4 and 23 from worksheet "WO" if the value in column 23 is greater than 0. The first two rows of this worksheet contain the header information. The data starts from row 3 onwards. This code works most of the time except that I am facing two situations as under:
a) If there is no data in the worksheet (last used row is 2), I get "Run-time error '91': Object variable or With block variable not set." I get the same error if there is data but none fit the criterion "column 23 > 0".
b) if there are 2 or more records to be displayed in the combobox, the information is displayed correctly in the columns. However, if there is only one record, each column is displayed one below the other as a row and I am able to select any row.
I have been trying to get over this problem but do not seem to find the right solution.
Would be grateful if some one can point out why I getting these problems and edit the code suitably for me.
Thanks in advance,
Anand Hattangady
Bookmarks