Multi-column list box with headers question...

T

Thurman

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
....and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Thurman

Ok, let me clairify some...

I don't get all the headers to show up, only for the 2 columns A and B that are in my range. And column B moves to the Column 8 possition instead of being placed in the column 2 possistion.

Hope that is clearer.

Thurman
Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
...and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Tom Ogilvy

Private Sub UserForm_Initialize()
lstStore.ColumnHeads = True
lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"


End Sub

worked fine for me in Excel 2000, SR1, US English, Win 2000

I filled the cells with their address

A7 B7 C7 etc
A8 B8 C8 etc

--
Regards,
Tom Ogilvy

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
...and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Tom Ogilvy

Headers work as well.

--
Regards,
Tom Ogilvy

Private Sub UserForm_Initialize()
lstStore.ColumnHeads = True
lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"


End Sub

worked fine for me in Excel 2000, SR1, US English, Win 2000

I filled the cells with their address

A7 B7 C7 etc
A8 B8 C8 etc

--
Regards,
Tom Ogilvy

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
...and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Thurman

Oh...the word DUH! comes to mind now.... I feel stupid. My data on the sheet, is in merged cells...the ranges don't match. A7:Y24 : 24-7 does not equal 9 columns.

Thurman
Headers work as well.

--
Regards,
Tom Ogilvy

Private Sub UserForm_Initialize()
lstStore.ColumnHeads = True
lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"


End Sub

worked fine for me in Excel 2000, SR1, US English, Win 2000

I filled the cells with their address

A7 B7 C7 etc
A8 B8 C8 etc

--
Regards,
Tom Ogilvy

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
...and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Thurman

Ok, my head is fried. I am doing the math on the numbers when it should be the letters, but it is the problem.
A to Y is 24 not 9
Oh...the word DUH! comes to mind now.... I feel stupid. My data on the sheet, is in merged cells...the ranges don't match. A7:Y24 : 24-7 does not equal 9 columns.

Thurman
Headers work as well.

--
Regards,
Tom Ogilvy

Private Sub UserForm_Initialize()
lstStore.ColumnHeads = True
lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"


End Sub

worked fine for me in Excel 2000, SR1, US English, Win 2000

I filled the cells with their address

A7 B7 C7 etc
A8 B8 C8 etc

--
Regards,
Tom Ogilvy

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
...and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so on...

What am I not doing? I get the headers for the columns to show up, I just am not getting the values for the complete range to populate in the list.


Thurman
 
T

Tom Ogilvy

That is true, but it didn't cause me a problem.

Having merged cells might be a problem.

--
Regards,
Tom Ogilvy

Ok, my head is fried. I am doing the math on the numbers when it should be
the letters, but it is the problem.
A to Y is 24 not 9
Oh...the word DUH! comes to mind now.... I feel stupid. My data on the
sheet, is in merged cells...the ranges don't match. A7:Y24 : 24-7 does not
equal 9 columns.

Thurman
Headers work as well.

--
Regards,
Tom Ogilvy

Private Sub UserForm_Initialize()
lstStore.ColumnHeads = True
lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"


End Sub

worked fine for me in Excel 2000, SR1, US English, Win 2000

I filled the cells with their address

A7 B7 C7 etc
A8 B8 C8 etc

--
Regards,
Tom Ogilvy

Ok, would someone be so kind as to help me here. I am losing my head.

I have a listbox with 9 columns, I want to use the column header feature, so
I set the following code:


lstStore.ColumnCount = 9
lstStore.ColumnWidths = "100;20;20;20;20;20;20;20;20"
lstStore.RowSource = "A7:Y24"

My results are as follows where as Colx is for viewing purposes with this
post and null is the absence of information:

Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
A7 null null null null null null B7 null
A8 null null null null null null B8 null
A9 null null null null null null B9 null
A10 null null null null null null B10 null
A11 null null null null null null B11 null
....and so on and so on (kinda hoping this will line up for the viewers)

It doesn't put the Bx in Col2 then put Cx in Col3 then Dx in Col4 and so
on...

What am I not doing? I get the headers for the columns to show up, I just am
not getting the values for the complete range to populate in the list.


Thurman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top