Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • outreg2: adding string to single excel cell

    I am trying to add a string test to outreg2 but the text is breaking into different cells or part of it is disappearing.

    More specifically, the text I want to add is a confidence interval from another estimator which I generated separately and saved in a local macro
    PHP Code:
    2.745715.75474

    Below is the code where I try to add this range to outreg2.

    Code:
    sysuse auto, clear
    
    local add_range = "[ 2.74571, 5.75474]"
    
    reg price weight
    
    outreg2 using "test.xls", excel nocons replace addtext(t1, `add_range', t2, "`add_range'", t3, ""`add_range'"")
    This is what I get

    Click image for larger version

Name:	Screenshot 2023-02-01 075150.png
Views:	1
Size:	11.1 KB
ID:	1699797


    I would like to get this

    Click image for larger version

Name:	Screenshot 2023-02-01 075852.png
Views:	1
Size:	9.9 KB
ID:	1699798
Working...
X