#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default additem

How do I use 'additem' on a listbox that has 7 columns in it?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default additem

For multi column listBox use the list property in the UF initialize event.

Private Sub UserForm_Initialize()
ListBox1.List(0, 0) = "FirstRow, FirstCol"
ListBox1.List(0, 1) = "FirstRow, SecondCol"
ListBox1.List(0, 2) = "FirstRow, ThirdCol"
End Sub

Remember the row and column indexes are zero based. If you have a large
number of items to add, you might want to use list fill from a range.

"ranswrt" wrote:

How do I use 'additem' on a listbox that has 7 columns in it?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default additem

I already have a listbox with items in it. I also have textboxes that get
the new data to add the the list box. What is the best way to add the new
data to the end of the list?
Thanks

"JLGWhiz" wrote:

For multi column listBox use the list property in the UF initialize event.

Private Sub UserForm_Initialize()
ListBox1.List(0, 0) = "FirstRow, FirstCol"
ListBox1.List(0, 1) = "FirstRow, SecondCol"
ListBox1.List(0, 2) = "FirstRow, ThirdCol"
End Sub

Remember the row and column indexes are zero based. If you have a large
number of items to add, you might want to use list fill from a range.

"ranswrt" wrote:

How do I use 'additem' on a listbox that has 7 columns in it?
Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.additem ernie Excel Programming 1 September 5th 06 05:31 PM
Help with: ListBox1.AddItem (ws.Name) Ron de Bruin Excel Worksheet Functions 0 May 18th 05 07:02 PM
AddItem Method Todd Huttenstine Excel Programming 3 April 21st 04 03:53 PM
Please help with AddItem method Shilps Excel Programming 2 April 19th 04 01:24 PM
.additem Robert Couchman[_4_] Excel Programming 3 February 20th 04 02:47 PM


All times are GMT +1. The time now is 04:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"