+ Reply to Thread
Results 1 to 3 of 3

How Print

Hybrid View

  1. #1
    John
    Guest

    How Print

    In a Macro How do you print a string in a macro?

    For instance: Print "Hi there" So "Hi there" goes to the printer.

    I tried all kinds of things but it keeps saying someting about an
    object. I'm trying to print a string variable.

    Thanks

    John

  2. #2
    Dave Peterson
    Guest

    Re: How Print

    I think that most people print a worksheet (or a range on a worksheet).

    So you could populate a cell with that string and then print that cell.

    Range("a1").value = "hi there"
    range("a1").printout

    But this kind of thing would work, too:

    Option Explicit
    Sub testme01()
    Open "LPT1:" For Output As #1
    Print #1, "Hi There"
    Close #1
    End Sub

    John wrote:
    >
    > In a Macro How do you print a string in a macro?
    >
    > For instance: Print "Hi there" So "Hi there" goes to the printer.
    >
    > I tried all kinds of things but it keeps saying someting about an
    > object. I'm trying to print a string variable.
    >
    > Thanks
    >
    > John


    --

    Dave Peterson

  3. #3
    John
    Guest

    Re: How Print

    I have a string produced by adding strings using "&" as in "a & b & c"
    When I use the Range("a1").value =, it only prints the the a of the
    a&b&c. Then it ejects the page and prints only the a of the next string
    etc.

    In other words... it isn't working very well.

    John

    Dave Peterson wrote:
    > I think that most people print a worksheet (or a range on a worksheet).
    >
    > So you could populate a cell with that string and then print that cell.
    >
    > Range("a1").value = "hi there"
    > range("a1").printout
    >


+ 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