<?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: Adding colors to the rows in Excel in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21441#M4521</link>
    <description>I have a similar question.  I need to create a excel spreadsheet with a light green color for the whole row whenever desc = 'diff' as well as the title row.  What should I do?  Please see code below.&lt;BR /&gt;
&lt;BR /&gt;
data diff(keep=n desc m2 m1 m0);&lt;BR /&gt;
  merge a b;&lt;BR /&gt;
  by n;&lt;BR /&gt;
  dm2  = sum(m2 , -bm2);&lt;BR /&gt;
  dm1  = sum(m1 , -bm1);&lt;BR /&gt;
  dm0  = sum(m0 , -bm0);&lt;BR /&gt;
  if abs(dm2 ) &amp;gt; 2&lt;BR /&gt;
  or abs(dm1 ) &amp;gt; 2&lt;BR /&gt;
  or abs(dm0 ) &amp;gt; 2;&lt;BR /&gt;
  output;&lt;BR /&gt;
  desc = bdesc;&lt;BR /&gt;
  m2   = bm2;&lt;BR /&gt;
  m1   = bm1;&lt;BR /&gt;
  m0   = bm0;&lt;BR /&gt;
  output;&lt;BR /&gt;
  desc = 'diff';&lt;BR /&gt;
  m2   = dm2;&lt;BR /&gt;
  m1   = dm1;&lt;BR /&gt;
  m0   = dm0;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc export data=diff&lt;BR /&gt;
            outfile="c:\diff.xls"&lt;BR /&gt;
            dbms=excel2000 replace;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Warren</description>
    <pubDate>Sat, 15 May 2010 20:01:49 GMT</pubDate>
    <dc:creator>Warren</dc:creator>
    <dc:date>2010-05-15T20:01:49Z</dc:date>
    <item>
      <title>Adding colors to the rows in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21439#M4519</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have a dataset which is ODSed to EXCEL.&lt;BR /&gt;
&lt;BR /&gt;
The dataset looks like this.&lt;BR /&gt;
&lt;BR /&gt;
Group  Panel  Value   Mean&lt;BR /&gt;
111        c       11.11  22.22&lt;BR /&gt;
111        c       12.12  21.21&lt;BR /&gt;
111        b       13.13  13.45&lt;BR /&gt;
222        a        45.45  56.56&lt;BR /&gt;
222        d        77.77  77.77&lt;BR /&gt;
222        d        88.55  66.66&lt;BR /&gt;
..........&lt;BR /&gt;
&lt;BR /&gt;
Now I need to color the dataset in which respect to Panel.&lt;BR /&gt;
&lt;BR /&gt;
Meaning  all panel c's under 111 gets a color, all panel b's under 111 get a different color.&lt;BR /&gt;
&lt;BR /&gt;
Please give me suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
Sandhya.</description>
      <pubDate>Thu, 13 May 2010 15:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21439#M4519</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-05-13T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Adding colors to the rows in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21440#M4520</link>
      <description>Hi:&lt;BR /&gt;
  I'm confused by your description of what you want. Your data/report looks like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Group   Panel Value  Mean&lt;BR /&gt;
111     c     11.11 22.22  &amp;lt;---pink&lt;BR /&gt;
111     c     12.12 21.21  &amp;lt;---pink&lt;BR /&gt;
111     b     13.13 13.45  &amp;lt;---yellow&lt;BR /&gt;
222     a     45.45 56.56  &amp;lt;--- what color for these???&lt;BR /&gt;
222     d     77.77 77.77&lt;BR /&gt;
222     d     88.55 66.66&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Are you saying that for group 111, when panel = c you want one color??? And then for Group=111 and panel=b, you want a different color?? &lt;BR /&gt;
&lt;BR /&gt;
And then WHAT do you want to color???  the panel cell??? You want to color the group cell and the panel cell??? Or you want to color the whole row???&lt;BR /&gt;
 &lt;BR /&gt;
Also, you indicate that you are using ODS to create a file that Excel can open...but are you using:&lt;BR /&gt;
ODS CSV&lt;BR /&gt;
ODS HTML&lt;BR /&gt;
ODS MSOFFICE2K&lt;BR /&gt;
ODS TAGSETS.EXCELXP?????&lt;BR /&gt;
 &lt;BR /&gt;
And, also, what is your procedure of choice?? Are you using PROC PRINT, PROC REPORT, PROC TABULATE?????&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 13 May 2010 16:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21440#M4520</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-13T16:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding colors to the rows in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21441#M4521</link>
      <description>I have a similar question.  I need to create a excel spreadsheet with a light green color for the whole row whenever desc = 'diff' as well as the title row.  What should I do?  Please see code below.&lt;BR /&gt;
&lt;BR /&gt;
data diff(keep=n desc m2 m1 m0);&lt;BR /&gt;
  merge a b;&lt;BR /&gt;
  by n;&lt;BR /&gt;
  dm2  = sum(m2 , -bm2);&lt;BR /&gt;
  dm1  = sum(m1 , -bm1);&lt;BR /&gt;
  dm0  = sum(m0 , -bm0);&lt;BR /&gt;
  if abs(dm2 ) &amp;gt; 2&lt;BR /&gt;
  or abs(dm1 ) &amp;gt; 2&lt;BR /&gt;
  or abs(dm0 ) &amp;gt; 2;&lt;BR /&gt;
  output;&lt;BR /&gt;
  desc = bdesc;&lt;BR /&gt;
  m2   = bm2;&lt;BR /&gt;
  m1   = bm1;&lt;BR /&gt;
  m0   = bm0;&lt;BR /&gt;
  output;&lt;BR /&gt;
  desc = 'diff';&lt;BR /&gt;
  m2   = dm2;&lt;BR /&gt;
  m1   = dm1;&lt;BR /&gt;
  m0   = dm0;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc export data=diff&lt;BR /&gt;
            outfile="c:\diff.xls"&lt;BR /&gt;
            dbms=excel2000 replace;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Warren</description>
      <pubDate>Sat, 15 May 2010 20:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21441#M4521</guid>
      <dc:creator>Warren</dc:creator>
      <dc:date>2010-05-15T20:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding colors to the rows in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21442#M4522</link>
      <description>Hi,&lt;BR /&gt;
The issue is that there are no colors and fonts in a SAS dataset. So with PROC EXPORT there are no ways to highlight or do traffic lighting or conditional highlighting.&lt;BR /&gt;
&lt;BR /&gt;
If you use ODS and PROC REPORT then you can highlight a whole row based on a condition, using the CALL DEFINE statement in a COMPUTE block.&lt;BR /&gt;
&lt;BR /&gt;
There are examples in previous forum postings if you search for traffic lighting or conditional highlighting, as well as in the PROC REPORT documentation.&lt;BR /&gt;
&lt;BR /&gt;
Cynthia</description>
      <pubDate>Sat, 15 May 2010 21:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21442#M4522</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-05-15T21:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding colors to the rows in Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21443#M4523</link>
      <description>I've found that I can use ods tagsets.excelxp with proc report and the following compute statement.&lt;BR /&gt;
&lt;BR /&gt;
  compute src;&lt;BR /&gt;
    if src = 'diff' then call define(_row_, "style", "style={foreground=blue}");&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
&lt;BR /&gt;
See also &lt;A href="http://support.sas.com/kb/23/353.html" target="_blank"&gt;http://support.sas.com/kb/23/353.html&lt;/A&gt;</description>
      <pubDate>Mon, 17 May 2010 17:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-colors-to-the-rows-in-Excel/m-p/21443#M4523</guid>
      <dc:creator>Warren</dc:creator>
      <dc:date>2010-05-17T17:08:28Z</dc:date>
    </item>
  </channel>
</rss>

