avadhutd2
10-28-2009, 02:15 AM
Hi,
Query How to access the element in the columns of a listbox where there are 2 or more columns?
The background below resembles my previous query posted yesterday -
I have a listbox that have 2 columns. First column is having "Name" and another is "Data Type".
I am having another listbox where I can transfer items from LISTBOX 1 to LISTBOX 2.
I am forming a SQL query based on selections available in LISTBOX 2.
That is....if user selects 3 items ...A, B & C then I will be having a query as -
SELECT A, B, C from DBNAME
My query is as follows:
In order to have the entire column formatted for the selected item in LISTBOX 2 in m-dd-yyyy where the column 2 in LISTBOX2 is Date I got resolution as -
If UserForm2.ListBox2.List(1, 1) = "DATE" Then
Sheet1.Columns(2).NumberFormat = "mm-dd-yyyy"
End If
But the problem is I am not able to get the value when I do ListBox2.List(1,1).
Please find attached a sample excel worksheet - "Multi_Column_ListBox.xls" . Please refer USERFORM1 code.
I had added 2 list listboxes & a button >> that transfers items to LISTBOX2.
I need to see whatever item I select from LISTBOX1 to LISTBOX2 one below the other & in two columns (currently I am getting them one below the other).
Can any one guide me here??
Query How to access the element in the columns of a listbox where there are 2 or more columns?
The background below resembles my previous query posted yesterday -
I have a listbox that have 2 columns. First column is having "Name" and another is "Data Type".
I am having another listbox where I can transfer items from LISTBOX 1 to LISTBOX 2.
I am forming a SQL query based on selections available in LISTBOX 2.
That is....if user selects 3 items ...A, B & C then I will be having a query as -
SELECT A, B, C from DBNAME
My query is as follows:
In order to have the entire column formatted for the selected item in LISTBOX 2 in m-dd-yyyy where the column 2 in LISTBOX2 is Date I got resolution as -
If UserForm2.ListBox2.List(1, 1) = "DATE" Then
Sheet1.Columns(2).NumberFormat = "mm-dd-yyyy"
End If
But the problem is I am not able to get the value when I do ListBox2.List(1,1).
Please find attached a sample excel worksheet - "Multi_Column_ListBox.xls" . Please refer USERFORM1 code.
I had added 2 list listboxes & a button >> that transfers items to LISTBOX2.
I need to see whatever item I select from LISTBOX1 to LISTBOX2 one below the other & in two columns (currently I am getting them one below the other).
Can any one guide me here??