Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Go Back  Xtreme Visual Basic Talk > > > > Texbox1.text to Listbox in Excel


Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2003, 08:45 AM
micropathic micropathic is offline
Freshman
 
Join Date: Jun 2003
Posts: 32
Default Texbox1.text to Listbox in Excel


I accidentally posted this question in the .net VBA forum instead of the legacy VBA forum. If a moderator sees this post, can you please move it to the right forum.... sorry


How can I add the text from a textbox to a listbox when I click a command button?

TIA

Last edited by micropathic; 12-31-2003 at 08:57 AM.
Reply With Quote
  #2  
Old 12-31-2003, 10:12 AM
Kluz's Avatar
KluzTexbox1.text to Listbox in Excel Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,443
Default

Code:
Private Sub CommandButton1_Click() With Me If .TextBox1 <> "" Then .ListBox1.AddItem .TextBox1.Value End If End With End Sub
__________________
No the other right mouse click
Reply With Quote
  #3  
Old 12-31-2003, 10:46 AM
micropathic micropathic is offline
Freshman
 
Join Date: Jun 2003
Posts: 32
Default

Thanks! that method seems to work pretty well. Just out of curiosity though, is there some way to edit a particular line in a listbox after text has been entered into it?

For instance, is there a way to do something along the lines of:

Code:
Private Sub CommandButton1_Click() TextBox1.Text = TextBox1.Text & "A" Dim mystr As String mystr = TextBox1.Text '*******The line below would be the one I think I need to change (for starters) ListBox1.AddItem (mystr) '*******Now instead of adding a new line for every time I click the 'button, I just want to "edit" the "-l" listindex line then when I hit 24 'characters in the line I want to have it automatically go to the next line '(listindex "1") and begin that process over again. '*******Is there some way to do that or is it too complicated? End Sub

Thanks again for any help!
Reply With Quote
  #4  
Old 12-31-2003, 12:45 PM
Kluz's Avatar
KluzTexbox1.text to Listbox in Excel Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,443
Default

This will get you started, still needs some modification (give it a shot)
Code:
With Me If Len(.ListBox1.List(.ListBox1.ListCount - 1)) < 24 Then .ListBox1.List(.ListBox1.ListCount - 1) = .ListBox1.List(.ListBox1.ListCount - 1) & "A" Else ListBox1.AddItem .TextBox1.Value & "A" End If End With
__________________
No the other right mouse click
Reply With Quote
  #5  
Old 12-31-2003, 02:58 PM
micropathic micropathic is offline
Freshman
 
Join Date: Jun 2003
Posts: 32
Thumbs up

That's genius! Thanks so much! It should definitely help me move forward on this project.

-micropathic
Reply With Quote
  #6  
Old 12-31-2003, 06:42 PM
Kluz's Avatar
KluzTexbox1.text to Listbox in Excel Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,443
Default

No problem, call again when you get stuck. And, have a Happy New Year.
__________________
No the other right mouse click
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
listbox sorting in excel mathurpc Excel 2 12-24-2003 09:17 AM
Excel to Listbox Haak3n Excel 3 08-08-2003 02:38 AM
Export date from listbox to Excel Elik Excel 10 07-11-2003 10:49 AM
Listbox and Textbox in excel combi MasterTom Excel 2 05-26-2003 07:29 AM
ListBox in Excel italkid Word, PowerPoint, Outlook, and Other Office Products 3 12-27-2002 03:23 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
 
Texbox1.text to Listbox in Excel
Texbox1.text to Listbox in Excel
 
-->