<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export to Multiple Existing Excel Files as New Sheets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863541#M341095</link>
    <description>&lt;P&gt;Thank you for your feedback. I'll stick with my ods excel export and move the tabs in excel.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 20:52:20 GMT</pubDate>
    <dc:creator>ark123</dc:creator>
    <dc:date>2023-03-10T20:52:20Z</dc:date>
    <item>
      <title>Export to Multiple Existing Excel Files as New Sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863517#M341090</link>
      <description>&lt;P&gt;I have multiple excel files saved. Each excel file is for an individual location and each has one sheet. I have additional data that I would like to add to each of these files. I am trying to add this data as an additional sheet to each of my existing excel files, again based on location.&lt;/P&gt;&lt;P&gt;So for example, one excel file might be named 'New York' with one tab named 'New York' and another might be an excel file named 'Michigan' with one tab named 'Michigan'. I would like to add an additional tab to each titled 'Missing' (if possible).&lt;/P&gt;&lt;P&gt;The code I am sharing produces a new excel file with each location in a separate tab. Instead of this output, is there a way to assign each tab to the existing excel files I have saved based on location (so if this output below has a tab 'New York' it would save as a new sheet title 'Missing' to the 'New York' excel file)?&lt;/P&gt;&lt;PRE&gt;ods excel file = "FILEPATH\Test.xlsx";	
ods excel options (sheet_interval="bygroup" sheet_name="#byval(Location)");

proc sort data = test;
	by location;
run;

options nobyline;
proc print data = test noobs;
	by location;
	var Patient_ID / style(data)=[fontfamily='calibri' fontsize=11pt foreground=black background=WHITE] style(header)=[fontfamily='calibri' fontsize=11pt foreground=black background=WHITE];
	var LastName / style(data)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP] style(header)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP];
	var FirstName / style(data)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP] style(header)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP];
	var DOB / style(data)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP] style(header)=[fontfamily='calibri' fontsize=11pt foreground=black background=PAP];
	var location / style(data)=[fontfamily='calibri' fontsize=11pt foreground=black background=VLIGB] style(header)=[fontfamily='calibri' fontsize=11pt foreground=black background=VLIGB];
run;
options byline;
ods excel close;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 18:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863517#M341090</guid>
      <dc:creator>ark123</dc:creator>
      <dc:date>2023-03-10T18:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Multiple Existing Excel Files as New Sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863518#M341091</link>
      <description>&lt;P&gt;ODS EXCEL cannot add sheets into existing Excel documents. It always creates a new Excel file.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 18:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863518#M341091</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-10T18:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Multiple Existing Excel Files as New Sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863529#M341092</link>
      <description>&lt;P&gt;Thank you for sharing that. Do you know of another way that this could be done?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863529#M341092</guid>
      <dc:creator>ark123</dc:creator>
      <dc:date>2023-03-10T20:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Multiple Existing Excel Files as New Sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863531#M341093</link>
      <description>&lt;P&gt;ODS EXCEL always creates a new file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT can add a new sheet to an existing workbook. &lt;A href="https://blogs.sas.com/content/sasdummy/2014/09/21/ods-excel-and-proc-export-xlsx/" target="_self"&gt;See examples here&lt;/A&gt;. But PROC EXPORT exports just data, not formatting/graphics like ODS EXCEL can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863531#M341093</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2023-03-10T20:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Multiple Existing Excel Files as New Sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863541#M341095</link>
      <description>&lt;P&gt;Thank you for your feedback. I'll stick with my ods excel export and move the tabs in excel.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-Multiple-Existing-Excel-Files-as-New-Sheets/m-p/863541#M341095</guid>
      <dc:creator>ark123</dc:creator>
      <dc:date>2023-03-10T20:52:20Z</dc:date>
    </item>
  </channel>
</rss>

