M
Mark Tangard
I have an Excel macro that finishes by displaying several lines of
results in a MsgBox. The output is arranged with the positioning
characters vbTab and vbCr so it aligns neatly.
When I do this in Word, I often give the user the option of printing the
MsgBox's text. It's easy to code -- just add a new document, set its
contents equal to the string that went into the MsgBox, and print. Word
interprets the vbCr and vbTab characters the same way in the MsgBox as
in the document.
Is there an easy way to do the same thing in Excel? -- to create a sheet
of printable results from formated MsgBox content? I know I could
parsing the MsgBox string into cell-shaped units and painstakingly
arrange them on a worksheet, but these messages can have several dozen
vbTab's and vbCR's, and the # of lines and tabs is never constant, so
that could be a huge job.
I've tried loading the MsgBox text into a new sheet's text box
(substituting vbLf's of vbCr's), and also into cell A1 after enlarging
it to fill the screen, but the vbTab characters of course remain ignored
in both cases. Other than a screenshot (which is what we're doing now),
is there a simpler way to handle this with code?
TIA
results in a MsgBox. The output is arranged with the positioning
characters vbTab and vbCr so it aligns neatly.
When I do this in Word, I often give the user the option of printing the
MsgBox's text. It's easy to code -- just add a new document, set its
contents equal to the string that went into the MsgBox, and print. Word
interprets the vbCr and vbTab characters the same way in the MsgBox as
in the document.
Is there an easy way to do the same thing in Excel? -- to create a sheet
of printable results from formated MsgBox content? I know I could
parsing the MsgBox string into cell-shaped units and painstakingly
arrange them on a worksheet, but these messages can have several dozen
vbTab's and vbCR's, and the # of lines and tabs is never constant, so
that could be a huge job.
I've tried loading the MsgBox text into a new sheet's text box
(substituting vbLf's of vbCr's), and also into cell A1 after enlarging
it to fill the screen, but the vbTab characters of course remain ignored
in both cases. Other than a screenshot (which is what we're doing now),
is there a simpler way to handle this with code?
TIA