Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing List Box Contents

Hi

Is there a way in Excel (VBA Code) to print to contents of a list box?

For example, I have an application that lists some financial figures
in a list box. Is there a way of sending these figures to a printer?

Martyn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing List Box Contents

Easiest would be to write them to a worksheet and print the range where they
are written.

An alternative is to use low level file io (guess it depends on what you are
actually doing)

Sub Macro5()
Dim ctrl as Long
Dim tmpstr as String
Open "LPT1:" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing ine " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub

If the printer is on a network, you would have to replace the LPT1 with the
network name.

--
Regards,
Tom Ogilvy


"Martyn Jones" wrote in message
om...
Hi

Is there a way in Excel (VBA Code) to print to contents of a list box?

For example, I have an application that lists some financial figures
in a list box. Is there a way of sending these figures to a printer?

Martyn



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing All the Contents of a Cell Ned Ertel Excel Worksheet Functions 1 November 27th 07 07:39 PM
Printing all text contents of Cell [email protected] Excel Discussion (Misc queries) 2 June 20th 07 12:54 AM
Printing cell contents problem jumar Excel Discussion (Misc queries) 0 May 23rd 06 03:22 PM
How do I prevent cell contents from printing? Tristan Excel Discussion (Misc queries) 2 March 1st 06 10:17 AM
Preventing cell contents from printing Blair Scanlan Excel Discussion (Misc queries) 5 December 20th 04 12:39 AM


All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"