Announcement

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

  • Forval loop to name an export excel file

    Hello,
    I am attempting to export a series of data to individual sheets in an excel file. I want to name the sheets [lname]_Teams, but I keep getting an invalid syntax error. Is this action possible with a loop? Alternatively, is there a more efficient way to approach this? Many thanks!

    CODE:

    forval i 1/10{

    export excel using "Drop_Teams_June2023" if total_records==`i', sheet("`i'_Teams") sheetmodify firstrow(variables)

    }

  • #2
    It's:

    Code:
    forval i = 1/10

    Comment


    • #3
      What an oversight on my end! Thank you so much Ken!

      Comment

      Working...
      X