Solved

How do you load items from a listbox into a variable?

Posted on 2009-07-07
3
160 Views
Last Modified: 2012-05-07
How would I load the contents in my listbox into a variable?
0
Comment
Question by:Taylor814
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
lppperes earned 500 total points
ID: 24800410
You can do something like this:

Dim i as Integer
Dim myVar as String

For i = 0 to ListBox1.ListCount - 1
    myVar = ListBox1.List(i) & ";"
Next
0
 

Author Comment

by:Taylor814
ID: 24800448
I had to add:

myVar = myVar & ListBox1.List(i) & ";"
0
 
LVL 2

Expert Comment

by:lppperes
ID: 24800499
Sorry about that.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now