Solved

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

Posted on 2009-07-07
3
162 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB error "Type mismatch" 2 54
VBA saving file message display 5 64
bit defender blocks good applications 2 94
Error when passing an argument to a vb6 that contains  '/' 7 37
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

770 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