Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Writing to An Array or Collection

I have 8 Textboxes that I want to add to a listbox in 8 colunms how can I do
this I have tried to write to a column but wont work, I am thinking of using
an array but not to sure how to do this I have used an array before but in
columns. the user will be adding to this array can anybody help please.
Charles
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Writing to An Array or Collection

With Listbox1
.AddItem Textbox1.Text
.List(.ListCount-1,1).Value = Textbox2
.List(.ListCount-1,2).Value = Textbox3
.List(.ListCount-1,3).Value = Textbox4
.List(.ListCount-1,4).Value = Textbox5

etc

End With

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
I have 8 Textboxes that I want to add to a listbox in 8 colunms how can I

do
this I have tried to write to a column but wont work, I am thinking of

using
an array but not to sure how to do this I have used an array before but in
columns. the user will be adding to this array can anybody help please.
Charles



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Writing to An Array or Collection

Tom I have tried this but it wont work asks for an object using the
list(listcount-1,1)
Charles

"Tom Ogilvy" wrote:

With Listbox1
.AddItem Textbox1.Text
.List(.ListCount-1,1).Value = Textbox2
.List(.ListCount-1,2).Value = Textbox3
.List(.ListCount-1,3).Value = Textbox4
.List(.ListCount-1,4).Value = Textbox5

etc

End With

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
I have 8 Textboxes that I want to add to a listbox in 8 colunms how can I

do
this I have tried to write to a column but wont work, I am thinking of

using
an array but not to sure how to do this I have used an array before but in
columns. the user will be adding to this array can anybody help please.
Charles




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Writing to An Array or Collection

My typo - shouldn't have included the .value

Private Sub CommandButton1_Click()
With ListBox1
.AddItem TextBox1.Text
.List(.ListCount - 1, 1) = TextBox2
.List(.ListCount - 1, 2) = TextBox3
.List(.ListCount - 1, 3) = TextBox4
.List(.ListCount - 1, 4) = TextBox5
End With
End Sub


worked for me with 5 textboxes and is easily expanded to 8.

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
Tom I have tried this but it wont work asks for an object using the
list(listcount-1,1)
Charles

"Tom Ogilvy" wrote:

With Listbox1
.AddItem Textbox1.Text
.List(.ListCount-1,1).Value = Textbox2
.List(.ListCount-1,2).Value = Textbox3
.List(.ListCount-1,3).Value = Textbox4
.List(.ListCount-1,4).Value = Textbox5

etc

End With

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
I have 8 Textboxes that I want to add to a listbox in 8 colunms how

can I
do
this I have tried to write to a column but wont work, I am thinking of

using
an array but not to sure how to do this I have used an array before

but in
columns. the user will be adding to this array can anybody help

please.
Charles






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Writing to An Array or Collection

Thanks

"Tom Ogilvy" wrote:

My typo - shouldn't have included the .value

Private Sub CommandButton1_Click()
With ListBox1
.AddItem TextBox1.Text
.List(.ListCount - 1, 1) = TextBox2
.List(.ListCount - 1, 2) = TextBox3
.List(.ListCount - 1, 3) = TextBox4
.List(.ListCount - 1, 4) = TextBox5
End With
End Sub


worked for me with 5 textboxes and is easily expanded to 8.

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
Tom I have tried this but it wont work asks for an object using the
list(listcount-1,1)
Charles

"Tom Ogilvy" wrote:

With Listbox1
.AddItem Textbox1.Text
.List(.ListCount-1,1).Value = Textbox2
.List(.ListCount-1,2).Value = Textbox3
.List(.ListCount-1,3).Value = Textbox4
.List(.ListCount-1,4).Value = Textbox5

etc

End With

--
Regards,
Tom Ogilvy

"vqthomf" wrote in message
...
I have 8 Textboxes that I want to add to a listbox in 8 colunms how

can I
do
this I have tried to write to a column but wont work, I am thinking of
using
an array but not to sure how to do this I have used an array before

but in
columns. the user will be adding to this array can anybody help

please.
Charles








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
Writing Range to Array Marston Excel Programming 3 August 9th 04 09:11 PM
Prb: Writing Array functions in VBA neebington Excel Programming 2 March 3rd 04 03:00 PM
writing array into excel sheet berrie Excel Programming 1 January 23rd 04 10:15 AM
Writing Array Formulas in VBA Ed Excel Programming 4 January 10th 04 07:27 PM
VBA: Writing an array function (like MMult) fxmolden Excel Programming 4 November 13th 03 07:45 PM


All times are GMT +1. The time now is 10:29 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"