+ Reply to Thread
Results 1 to 2 of 2

How do I print the contents of a textbox that is on a Userform

  1. #1
    DMS
    Guest

    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. #2
    Guest

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1