Group:  Microsoft Excel ยป microsoft.public.excel.newusers
Thread: How Print

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How Print
John <JOhn6328[ at ]mchsi.com> 16.07.2006 18:25:26
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
Re: How Print
Dave Peterson <petersod[ at ]verizonXSPAM.net> 16.07.2006 19:47:09
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:
[Quoted Text]
>
> 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
Re: How Print
John <JOhn6328[ at ]mchsi.com> 17.07.2006 15:31:47
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:
[Quoted Text]
> 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
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net