Vba listbox column width

NPALLATT

New Member
Joined
Jun 5, 2012
Messages
1
Hi, I want to fill a listbox with n columns so there is no space other than the text in it.

I have tried this:

listbox1.columncount = 2
listbox1.columnwidth(len(activecell.text);len(activecell.offset(0,1).text))

Or:

mystring = len(activrcell.value) or refer to the excel column width

listbox1.columnwidth(mystring;mystring2)

but I get an error message.:(

Or max of list len or something. The default width is to big and specifying the length could make it to small.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
"Hi, I want to fill a listbox with n columns so there is no space other than the text in it."

EHhh?
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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