Help with List Box Headings

Help with List Box Headings

Anonymous
Not applicable
392 Views
12 Replies
Message 1 of 13

Help with List Box Headings

Anonymous
Not applicable
Could someone please help?

I have a list box with 4 columns and the headings property set to true.
When I run my program, the headings show up but are empty.
I would like the put some heading titles and cant figure out how.

The help for this process is of little help and reads:
When the system uses the first row of data items as column headings, they
can't be selected.
I can't figure out how to use the first row of data items as column
headings.

Thanks in advance,
Jeff
0 Likes
393 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
A list box or a grid?

"Jeff" wrote in message
news:852f21$9o325@adesknews2.autodesk.com...
> Could someone please help?
>
> I have a list box with 4 columns and the headings property set to true.
> When I run my program, the headings show up but are empty.
> I would like the put some heading titles and cant figure out how.
>
> The help for this process is of little help and reads:
> When the system uses the first row of data items as column headings, they
> can't be selected.
> I can't figure out how to use the first row of data items as column
> headings.
>
> Thanks in advance,
> Jeff
>
>
0 Likes
Message 3 of 13

Anonymous
Not applicable
Thanks for responding Frank,

It's a list box.

Thanks
Jeff

Frank Oquendo wrote in message <852fl7$9o326@adesknews2.autodesk.com>...
>A list box or a grid?
0 Likes
Message 4 of 13

Anonymous
Not applicable
Jeff,
Check out the help files for the textcolumn property. I think that's
what your looking for.
-Josh

Jeff wrote:

> Thanks for responding Frank,
>
> It's a list box.
>
> Thanks
> Jeff
>
> Frank Oquendo wrote in message <852fl7$9o326@adesknews2.autodesk.com>...
> >A list box or a grid?
0 Likes
Message 5 of 13

Anonymous
Not applicable
You may be misunderstanding the use of columns in a list box. Columns cause
a list box to scroll horizontally as opposed to vertically. If you want
columns that you can enter specific items into (like a record in a
database), use a grid instead.

"Jeff" wrote in message
news:8532so$bq449@adesknews2.autodesk.com...
> Josh,
>
> Thanks for the help, but the textcolumn sets the active column to read
from.
> I want to give the headings a name.
>
> Thanks
> Jeff
>
> Minkwitz Design wrote in message <3874E628.AFA64232@xta.com>...
> >Jeff,
> > Check out the help files for the textcolumn property. I think that's
> >what your looking for.
> >-Josh
> >
>
>
>
0 Likes
Message 6 of 13

Anonymous
Not applicable
Josh,

Thanks for the help, but the textcolumn sets the active column to read from.
I want to give the headings a name.

Thanks
Jeff

Minkwitz Design wrote in message <3874E628.AFA64232@xta.com>...
>Jeff,
> Check out the help files for the textcolumn property. I think that's
>what your looking for.
>-Josh
>
0 Likes
Message 7 of 13

Anonymous
Not applicable
Frank,

Thanks again!
You may be right that I am misunderstanding the use of columns.
I'm not sure how to use a grid control. I didn't think there is one.
I'm new to programming with vba.

Here is a sample of the code I'm using:

Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 3
ListBox1.ColumnHeads = True

ListBox1.AddItem "Row 1, Col 1"
ListBox1.List(0, 1) = "Row 1, Col 2"
ListBox1.List(0, 2) = "Row 1, Col 3"

ListBox1.AddItem "Row 2, Col 1"
ListBox1.List(1, 1) = "Row 2, Col 2"
ListBox1.List(1, 2) = "Row 2, Col 3"

ListBox1.AddItem "Row 3, Col 1"
ListBox1.List(2, 1) = "Row 3, Col 2"
ListBox1.List(2, 2) = "Row 3, Col 3"

End Sub

Frank Oquendo wrote in message <8533ci$dr91@adesknews2.autodesk.com>...
>You may be misunderstanding the use of columns in a list box. Columns cause
>a list box to scroll horizontally as opposed to vertically. If you want
>columns that you can enter specific items into (like a record in a
>database), use a grid instead.
>
0 Likes
Message 8 of 13

Anonymous
Not applicable
I must have missed the VBA part. You are correct, there is no grid available
in stock VBA.

"Jeff" wrote in message
news:8534ab$drd5@adesknews2.autodesk.com...
> Frank,
>
> Thanks again!
> You may be right that I am misunderstanding the use of columns.
> I'm not sure how to use a grid control. I didn't think there is one.
> I'm new to programming with vba.
>
> Here is a sample of the code I'm using:
>
> Private Sub UserForm_Initialize()
> ListBox1.ColumnCount = 3
> ListBox1.ColumnHeads = True
>
> ListBox1.AddItem "Row 1, Col 1"
> ListBox1.List(0, 1) = "Row 1, Col 2"
> ListBox1.List(0, 2) = "Row 1, Col 3"
>
> ListBox1.AddItem "Row 2, Col 1"
> ListBox1.List(1, 1) = "Row 2, Col 2"
> ListBox1.List(1, 2) = "Row 2, Col 3"
>
> ListBox1.AddItem "Row 3, Col 1"
> ListBox1.List(2, 1) = "Row 3, Col 2"
> ListBox1.List(2, 2) = "Row 3, Col 3"
>
>
> End Sub
>
>
> Frank Oquendo wrote in message <8533ci$dr91@adesknews2.autodesk.com>...
> >You may be misunderstanding the use of columns in a list box. Columns
cause
> >a list box to scroll horizontally as opposed to vertically. If you want
> >columns that you can enter specific items into (like a record in a
> >database), use a grid instead.
> >
>
>
>
0 Likes
Message 9 of 13

Anonymous
Not applicable
Jeff - Have yuo considered using a LISTVIEW in report mode instead?

Jeff wrote:
>
> Frank,
>
> Thanks again!
> You may be right that I am misunderstanding the use of columns.
> I'm not sure how to use a grid control. I didn't think there is one.
> I'm new to programming with vba.
>
> Here is a sample of the code I'm using:
>
> Private Sub UserForm_Initialize()
> ListBox1.ColumnCount = 3
> ListBox1.ColumnHeads = True
>
> ListBox1.AddItem "Row 1, Col 1"
> ListBox1.List(0, 1) = "Row 1, Col 2"
> ListBox1.List(0, 2) = "Row 1, Col 3"
>
> ListBox1.AddItem "Row 2, Col 1"
> ListBox1.List(1, 1) = "Row 2, Col 2"
> ListBox1.List(1, 2) = "Row 2, Col 3"
>
> ListBox1.AddItem "Row 3, Col 1"
> ListBox1.List(2, 1) = "Row 3, Col 2"
> ListBox1.List(2, 2) = "Row 3, Col 3"
>
> End Sub
>
> Frank Oquendo wrote in message <8533ci$dr91@adesknews2.autodesk.com>...
> >You may be misunderstanding the use of columns in a list box. Columns cause
> >a list box to scroll horizontally as opposed to vertically. If you want
> >columns that you can enter specific items into (like a record in a
> >database), use a grid instead.
> >

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 10 of 13

Anonymous
Not applicable
Tony,

I don't understand you mean.

Thanks for the help,
Jeff

Tony Tanzillo wrote in message <38751E0F.79A41900@worldnet.att.net>...
>Jeff - Have yuo considered using a LISTVIEW in report mode instead?
>
>Jeff wrote:
>>
>> Frank,
>>
>> Thanks again!
>> You may be right that I am misunderstanding the use of columns.
>> I'm not sure how to use a grid control. I didn't think there is one.
>> I'm new to programming with vba.
>>
>> Here is a sample of the code I'm using:
>>
>> Private Sub UserForm_Initialize()
>> ListBox1.ColumnCount = 3
>> ListBox1.ColumnHeads = True
>>
>> ListBox1.AddItem "Row 1, Col 1"
>> ListBox1.List(0, 1) = "Row 1, Col 2"
>> ListBox1.List(0, 2) = "Row 1, Col 3"
>>
>> ListBox1.AddItem "Row 2, Col 1"
>> ListBox1.List(1, 1) = "Row 2, Col 2"
>> ListBox1.List(1, 2) = "Row 2, Col 3"
>>
>> ListBox1.AddItem "Row 3, Col 1"
>> ListBox1.List(2, 1) = "Row 3, Col 2"
>> ListBox1.List(2, 2) = "Row 3, Col 3"
>>
>> End Sub
>>
0 Likes
Message 11 of 13

Anonymous
Not applicable
He's referring to yet another control that is not present in the VBA
toolbox. Right click on your toolbox and select 'Additional Controls'. In
the resulting listbox, find and select the Microsoft Listview Control. Add
one to your form and use its properties to set up your columns. Refer to the
online help for more details

"Jeff" wrote in message
news:854mos$g4v3@adesknews2.autodesk.com...
> Tony,
>
> I don't understand you mean.
>
> Thanks for the help,
> Jeff
0 Likes
Message 12 of 13

Anonymous
Not applicable
Frank,

Thank you very much for your help and patients. I think the Listview
Control is exactly what I need and more, Much more. With some of the other
properties of this control, I think I'll save several lines of code in other
areas of my program.

The one last question I have is how do you find help online for this item. I
looked at both Microsoft Visual Basic Site and Autodesk Web Site.

Thanks again,
Jeff

Frank Oquendo wrote in message <8551vj$g4s27@adesknews2.autodesk.com>...
>He's referring to yet another control that is not present in the VBA
>toolbox. Right click on your toolbox and select 'Additional Controls'. In
>the resulting listbox, find and select the Microsoft Listview Control. Add
>one to your form and use its properties to set up your columns. Refer to
the
>online help for more details
>
0 Likes
Message 13 of 13

Anonymous
Not applicable
Typically, you can select the actual control on your UserForm and press F1.
Also, be sure to use the Object Explorer extensively. Press F2.

Jeff wrote in message
news:857gev$mt52@adesknews2.autodesk.com...
> Frank,
>
> Thank you very much for your help and patients. I think the Listview
> Control is exactly what I need and more, Much more. With some of the other
> properties of this control, I think I'll save several lines of code in
other
> areas of my program.
>
> The one last question I have is how do you find help online for this item.
I
> looked at both Microsoft Visual Basic Site and Autodesk Web Site.
>
> Thanks again,
> Jeff
0 Likes