Left-aligning a ListBox column when all other columns are centered

Bagharmin

Board Regular
Joined
Nov 22, 2010
Messages
168
I have a ListBox with 6 columns. All 6 are currently center-aligned, but I want the first column to be left-aligned. Is there a way to change the alignment of just that one column or do they all have to be aligned the same way?

Thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Sorry, the short answer is no you can't align individual columns.

You could try a ListView control but they are a little harder to work with to start with, and you might have problems with people being able to access them if
they are using different versions etc.

You could also try and add spaces or something to simulate some sort of alignment but I've never seen any succesful code for doing that.
 
Upvote 0
Rats. How about pretty-ing it up in other ways? Are things like column borders or coloring alternating rows possible? Or is it just one-size-fits-all in general?
 
Upvote 0
List Box (and combo box) formatting applies to all entries the same way.

Column borders could be simulated by putting the pipe character (|) in a narrow column (widths of individual columns can be set to varying values with the .ColumnWidths property)
 
Upvote 0
You can do some formatting with a ListView, and actually a few other things.

The main problem I've seen people having with those is that when it comes to distributing the workbook the control that's been used isnt' supported.

That can happen for a couple of reasons, perhaps the most common one being different versions of either the control or Excel itself.

I could post a workbook with a listview example but it's a pretty simple example and might not illustrate all the options that are available.

In fact right now the only one I can think of, or which I think I've used, is adding images.

Sure's there's more than that though.:)
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,245
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top