Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DMS DMS is offline
external usenet poster
 
Posts: 9
Default How do I print the contents of a textbox that is on a Userform

This problem has been driving me up a wall. It seems very easy but I can't
find the answer anywhere.

I have a Userform with a text box on it. I use this textbox to list errors
that my macro finds. I would like my users to be able to print the contents
of the textbox. Any ideas.

I have tried the following.
Printer.Print Userform1.textbox1.text

When I run this code I get an error that says "Object Required"

Any help would be appreciated.

DMS
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default How do I print the contents of a textbox that is on a Userform

I'm not sure if this will work but give it a try.
Range("A1").Select
ActiveCell = Userform1.textbox1
ActiveSheet.PageSetup.PrintArea = "$A$1"
ActiveCell.Columns
("A:A").EntireColumn.EntireColumn.AutoFit
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
Collate:=True

Let me know how this turns out. Replace A1 and "$A$1"
with a blank cell somewhere in your worksheet where you
could print the output.
Mike J
-----Original Message-----
This problem has been driving me up a wall. It seems

very easy but I can't
find the answer anywhere.

I have a Userform with a text box on it. I use this

textbox to list errors
that my macro finds. I would like my users to be able

to print the contents
of the textbox. Any ideas.

I have tried the following.
Printer.Print Userform1.textbox1.text

When I run this code I get an error that says "Object

Required"

Any help would be appreciated.

DMS
.

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
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Textbox in userform Harald Staff Excel Programming 0 September 8th 04 11:51 AM
Textbox in userform shaharul[_6_] Excel Programming 3 April 15th 04 12:54 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM
Help with Syntax UserForm TextBox John Wilson Excel Programming 1 July 28th 03 04:15 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"