Dear All,
I need to write output to Excel. I am using -putexcel- for this purpose.
In some of the cells, I need the content to be aligned on multiple lines (contain line breaks).
(When working with Excel interactively this is done according to the steps shown here.)
I have tried this with the following approach in Stata:
The result I am getting is a partial success: the edit line shows that there is a line break embedded into the content, but the content of the cell A1 is a run-together text of what I expected to be placed in two different lines.

The correct result that I expect is shown in the next screenshot (B1 - manual edit).

I have experimented with:
Can anyone suggest a way of getting the text properly aligned in multiple lines immediately from Stata code?
Thank you very much,
Sergiy Radyakin
I need to write output to Excel. I am using -putexcel- for this purpose.
In some of the cells, I need the content to be aligned on multiple lines (contain line breaks).
(When working with Excel interactively this is done according to the steps shown here.)
I have tried this with the following approach in Stata:
Code:
clear all putexcel set "C:\temp\out1.xlsx", replace putexcel A1 = ("AAA`=char(13)'BBB") putexcel save
The correct result that I expect is shown in the next screenshot (B1 - manual edit).
I have experimented with:
- including chars with codes (10), (13), (10 and 13) in various combinations,
- adding option overwritefmt,
Can anyone suggest a way of getting the text properly aligned in multiple lines immediately from Stata code?
Thank you very much,
Sergiy Radyakin
Comment