ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding string to PrintOut? (https://www.excelbanter.com/excel-programming/443581-adding-string-printout.html)

Ed from AZ

Adding string to PrintOut?
 
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[_2_]

Adding string to PrintOut?
 
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


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com