Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Writing Range to Array | Excel Programming | |||
Prb: Writing Array functions in VBA | Excel Programming | |||
writing array into excel sheet | Excel Programming | |||
Writing Array Formulas in VBA | Excel Programming | |||
VBA: Writing an array function (like MMult) | Excel Programming |