Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2004, 01:22 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing a textbox

Hi i'm doing a college project and ive just about finished but i need to be able to print the information thats in a textbox on a userform. I don't mind whether it prints the whole userform or even takes a screen shot if thats possible, but i need to be able to make a commandn button which prints the information in the textbox.

Any ideas?

thanks

 
Old June 15th, 2004, 02:41 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

Hi

Is this a form you created in the excel spreadsheet? If its in the spreadsheet you just need to add (e.g)

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

You add this code to the command button's onClick event. You could also link the textbox to a cell which you could select and use:

Selection.PrintOut Copies:=1, Collate:=True

This will then only print the data and not txtbox itself.

Is this what you are looking for?

Regards
Marnus
 
Old June 16th, 2004, 03:21 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes that worked thankyou very much.






Similar Threads
Thread Thread Starter Forum Replies Last Post
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
Printing in C# ranakdinesh General .NET 1 June 28th, 2005 05:22 AM
capturing printing settings when printing reports nikolaosk Access VBA 0 February 8th, 2005 04:14 AM
TextBox (Align Center) Problem on Printing mrhyman VB How-To 9 February 19th, 2004 12:14 PM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.