Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
listbox.Columnwidths question
The following statement does not appear to have
effect: Private Sub frmName_Contractors_Initialize() lbDataCode.Width = 100 lbDataCode.ColumnCount = 2 lbDataCode.ColumnWidths = "6;94" End Sub I've changed the overall width.....increasing it I've narrowed column1 and widened 2. Columnwidths are not set in the listbox object. Why are the changes not being seen in the form, please? Regards. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
listbox.Columnwidths question
open a new workbook.
Add a userform. Useform1 textbox1 textbox2 textbox3 listbox1 put three textboxes above the listbox. Make the userform significantly wider than the listbox Put in the following code Private Sub TextBox1_Change() ListBox1.Width = CLng(TextBox1.Value) End Sub Private Sub TextBox2_Change() ListBox1.ColumnWidths = Trim(TextBox2.Value) & ";" & Trim(TextBox3.Value) End Sub Private Sub TextBox3_Change() ListBox1.ColumnWidths = Trim(TextBox2.Value) & ";" & Trim(TextBox3.Value) End Sub Private Sub UserForm_Initialize() ListBox1.ColumnCount = 2 For i = 1 To 10 With ListBox1 .AddItem "AAAAAAAAAAAAAAAAAAAAAAAAA" .List(.ListCount - 1, 1) = "BBBBBBBBBBBBBBBBBBBBBBBBB" End With Next End Sub Put in a width for the listbox in textbox1. Then put in a width for column 1 in textbox2 and a width for column 2 in textbox3. play with the settings by changing the values in the textboxes. Anyway, worked fine for me. -- Regards, Tom Ogilvy Stuart wrote in message ... The following statement does not appear to have effect: Private Sub frmName_Contractors_Initialize() lbDataCode.Width = 100 lbDataCode.ColumnCount = 2 lbDataCode.ColumnWidths = "6;94" End Sub I've changed the overall width.....increasing it I've narrowed column1 and widened 2. Columnwidths are not set in the listbox object. Why are the changes not being seen in the form, please? Regards. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ListBox Question | Excel Worksheet Functions | |||
Listbox Question | Excel Worksheet Functions | |||
listbox question | Excel Programming | |||
Paste columnwidths in Xl2k problem | Excel Programming | |||
Listbox question | Excel Programming |