<?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: Color cells by conditional formatting in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808490#M98797</link>
    <description>&lt;P&gt;This looks for value "F" but most likely gives some ideas what you could change (get all rows beforehand for each column, color cells argument ordering, ...)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

colnames = dt &amp;lt;&amp;lt; get column names(character, string);

For Each({colname}, colnames,
	r = Loc(dt[0, colname], "F");
	If(N Items(r) &amp;gt; 0,
		Column(dt, colname) &amp;lt;&amp;lt; Color Cells("Red", r);
	);
);

Write();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Removed unnecessary Show(r); from the loop&lt;/P&gt;</description>
    <pubDate>Sat, 26 Oct 2024 18:37:51 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-10-26T18:37:51Z</dc:date>
    <item>
      <title>Color cells by conditional formatting</title>
      <link>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808479#M98795</link>
      <description>&lt;P&gt;I need a script that looks through all columns and color cells with the value "&amp;lt; LOD". My script does not give the desired outcome. Any advice?&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

// Get all of the column names in the data table
ColNames = dt &amp;lt;&amp;lt; get column names( string );
NRows = N Rows( dt );

// Loop through each column and row to find "&amp;lt; LOD" and color the previous cell
For( i = 1, i &amp;lt;= N Items( ColNames ), i++,
	column = Column( dt, ColNames[i] );
	For( j = 2, j &amp;lt;= NRows, j++, // Start at row 2 to avoid coloring out-of-bound cells
		If( Row(j) == "&amp;lt; LOD",
			column &amp;lt;&amp;lt; Color Cells( j - 1, "Red" );
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 26 Oct 2024 18:24:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808479#M98795</guid>
      <dc:creator>Steffen_Bugge</dc:creator>
      <dc:date>2024-10-26T18:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Color cells by conditional formatting</title>
      <link>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808489#M98796</link>
      <description>&lt;P&gt;Other and more elegant solutions are more than welcome!&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2024 18:30:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808489#M98796</guid>
      <dc:creator>Steffen_Bugge</dc:creator>
      <dc:date>2024-10-26T18:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Color cells by conditional formatting</title>
      <link>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808490#M98797</link>
      <description>&lt;P&gt;This looks for value "F" but most likely gives some ideas what you could change (get all rows beforehand for each column, color cells argument ordering, ...)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

colnames = dt &amp;lt;&amp;lt; get column names(character, string);

For Each({colname}, colnames,
	r = Loc(dt[0, colname], "F");
	If(N Items(r) &amp;gt; 0,
		Column(dt, colname) &amp;lt;&amp;lt; Color Cells("Red", r);
	);
);

Write();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Removed unnecessary Show(r); from the loop&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2024 18:37:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-cells-by-conditional-formatting/m-p/808490#M98797</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-26T18:37:51Z</dc:date>
    </item>
  </channel>
</rss>

