我需要一个脚本来查看所有值为“< LOD”的列和颜色单元格。我的脚本没有给出所需的结果。有什么建议吗?
dt = Current Data Table();
// Get all of the column names in the data table
ColNames = dt << get column names( string );
NRows = N Rows( dt );
// Loop through each column and row to find "< LOD" and color the previous cell
For( i = 1, i <= N Items( ColNames ), i++,
column = Column( dt, ColNames[i] );
For( j = 2, j <= NRows, j++, // Start at row 2 to avoid coloring out-of-bound cells
If( Row(j) == "< LOD",
column << Color Cells( j - 1, "Red" );
)
);
);
这将查找值“F”,但最有可能提供一些您可以更改的想法(预先获取每列的所有行、颜色单元格参数排序,...)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
colnames = dt << get column names(character, string);
For Each({colname}, colnames,
r = Loc(dt[0, colname], "F");
If(N Items(r) > 0,
Column(dt, colname) << Color Cells("Red", r);
);
);
Write();
编辑:从循环中删除不必要的 Show(r);