Solved

Printing individual items in a list box

Posted on 2001-06-26
2
153 Views
Last Modified: 2010-05-02
Hello. This is a basic question, I'm sure. I am trying to print to a sequential file the individual items that I have selected from a list box. So far I have only been able to get the index number of the items to print, not the actual name of the item. How can I print the actual name of the list items when they are selected? Thanks.
0
Comment
Question by:Ahobs
2 Comments
 
LVL 3

Accepted Solution

by:
Hornet241 earned 50 total points
ID: 6229204
try this

ff = FreeFile
Open "C:\YourFileName.Ext" for Output as #ff

For a = 0 to List1.Listcount - 1
    If List1.Selected(a) Then
        Print #ff, List1.List(a)
    End If
Next a

Close #ff
0
 

Author Comment

by:Ahobs
ID: 6229268
Thanks for the speedy reply. It works!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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

10 Experts available now in Live!

Get 1:1 Help Now