<?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: SAS code to update specific cell values in Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885151#M349724</link>
    <description>&lt;P&gt;Don't even try to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either write the whole report using SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or export the data that updates to a data sheet (where formatting is of no importance) and use Excel's ability to reference values from other sheets to make the report look like you want.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 19:01:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-07-17T19:01:37Z</dc:date>
    <item>
      <title>SAS code to update specific cell values in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885125#M349716</link>
      <description>&lt;P&gt;I have a report with everything formatted, and I need to update some cell values on a regular basis. Updates were made using PROC SQL, is there a way to let SAS automatically update the cell values after running PROC SQL?&lt;/P&gt;
&lt;P&gt;For instance, the cells that need to be updated each time are: A32, A43, A60. Let's say the excel file name is called test.xlsx. Below is a snippet of the PROC SQL code I am running to update those cells:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select count(distinct uci_0) format comma10.0 as caseload,
		     sum(claim) format dollar12.0 as pos
				from pos&amp;amp;fy.
				(where=(uci_0 ne . &amp;amp; svscd in ("950", "952") or (include=1 &amp;amp; totind ne . &amp;amp; uci_0 ne .)));
	quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 17:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885125#M349716</guid>
      <dc:creator>kevsma</dc:creator>
      <dc:date>2023-07-17T17:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to update specific cell values in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885151#M349724</link>
      <description>&lt;P&gt;Don't even try to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either write the whole report using SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or export the data that updates to a data sheet (where formatting is of no importance) and use Excel's ability to reference values from other sheets to make the report look like you want.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 19:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885151#M349724</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-17T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to update specific cell values in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885157#M349727</link>
      <description>&lt;P&gt;I concur with Tom and recommend the last option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Write the output to a new sheet, that gets overwritten as necessary and is linked to the cells that need updating.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 19:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885157#M349727</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-17T19:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code to update specific cell values in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885251#M349788</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Here is an example*/
libname x excel 'c:\temp\test.xlsx' scan_text='no';
proc sql;
update x.'Sheet1$'n
set b='z' where a=2;
quit;
libname x clear;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1689680266151.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85877i88D34FF68293D5FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1689680266151.png" alt="Ksharp_0-1689680266151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885251#M349788</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-07-18T11:37:29Z</dc:date>
    </item>
  </channel>
</rss>

