PC Review


Reply
Thread Tools Rate Thread

Adding string to PrintOut?

 
 
Ed from AZ
Guest
Posts: n/a
 
      2nd Sep 2010
At the end of my (XL2007) macro code, I have
wks1.Range("BA" & rwSt - 1 & ":BG" & rwEnd + 11).PrintOut

During the macro execution, I build a multi-line text string (multi-
lined by virtue of several vbCrLf), and show it to the user via
MsgBox.

How can I add the multi-line text string to my PrintOut?
Preferably on a separate page?

Ed
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      2nd Sep 2010
Dim NewWks as worksheet
....

Set NewWks = worksheets.add

with newwks
with .range("A1")
.wrapText = True
.value = myString 'whatever your variable is
'any more formatting you want -- widen the column, increase the rowheight??
.printout 'preview:=true 'for testing
end with
application.displayalerts = false
.delete
application.displayalerts = true
end with



On 09/01/2010 18:32, Ed from AZ wrote:
> At the end of my (XL2007) macro code, I have
> wks1.Range("BA"& rwSt - 1& ":BG"& rwEnd + 11).PrintOut
>
> During the macro execution, I build a multi-line text string (multi-
> lined by virtue of several vbCrLf), and show it to the user via
> MsgBox.
>
> How can I add the multi-line text string to my PrintOut?
> Preferably on a separate page?
>
> Ed


--
Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a vb.net value to a html string Aussie Rules Microsoft ASP .NET 2 14th Sep 2007 08:42 PM
Re: Adding Text to a String Debra Dalgleish Microsoft Excel Misc 0 29th Nov 2006 05:34 AM
adding a value to a string amitbadgi@gmail.com Microsoft Dot NET Framework 1 19th Sep 2005 09:06 PM
adding a value to a string amitbadgi@gmail.com Microsoft ASP .NET 1 19th Sep 2005 09:06 PM
Adding characters to a string : Error 'string.this[int]' cannot be assigned to -- it is read only J. Oliver Microsoft C# .NET 4 29th Sep 2003 07:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:51 AM.