顏色單元你好,
如何使空單元格或帶點單元格變灰?

我的是16.1版。
謝謝
資料存取回覆:顏色單元格如果變灰是指更改儲存格顏色,最簡單的選項很可能是基於腳本的。 一種選擇是使用 << Get RowsWhere 取得要著色的行,然後使用 << Color Cells 設定這些行的顏色
Names Default To Here(1);
dt = Current Data Table();
For Each({colname}, dt << Get Column Names("String"),
rows_to_color = dt << Get Rows Where(Is Missing(Column(dt, colname)[]));
Column(dt, colname) << Color Cells("Gray", rows_to_color);
dt << Clear Select;
);

回覆:顏色單元格如果您希望對每一列執行此操作,可以使用此腳本。
For Each( {col}, dt << Get Column Names( "String" ),
Eval(
Eval Expr(
dt << Select Where( Is Missing( As Column( Expr( col ) ) ) );
Expr( Column( col ) ) << Color Cells( "gray" );
dt << Clear Select;
)
)
);*編輯
Expr() 和所有這些都是完全不必要的。@jthi用他的例子指出了這一點。
For Each( {col}, dt << Get Column Names( "String" ),
dt << Select Where( Is Missing( As Column( col ) ) );
Column( col ) << Color Cells( "gray" );
dt << Clear Select;
);
回覆:顏色單元格@mmarchandTSI您可能還想新增檢查是否選擇了某些行(<< Color Cells 否則將為所有儲存格著色)。
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
Compress File When Saved(1),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([., ., 1])),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([2, 3, 4]))
);
For Each({col}, dt << Get Column Names("String"),
dt << Select Where(Is Missing(As Column(col)));
Column(col) << Color Cells("gray");
dt << Clear Select;
);
/*
For Each({col}, dt << Get Column Names("String"),
dt << Select Where(Is Missing(As Column(col)));
If(N Items(dt << Get Selected Rows) > 0,
Column(col) << Color Cells("gray");
);
dt << Clear Select;
);
*/回覆:顏色單元格應該沒問題,因為 <
dt << Select Where( Is Missing( As Column( col ) ), current selection( "clear" ) )
回覆:顏色單元格嗨,賈莫,
我可以在哪裡添加這個選項?抱歉,我是 JMP 軟體的新手。
回覆:顏色單元格我的意思是,如果根本沒有選擇任何行,則該列中的所有單元格都將被著色。
在這種情況下,Age 中的所有儲存格都會著色,因為沒有選取任何行
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
wait(1);
:Age << Color Cells("Red");
wait(1);
dt << Select Rows([2,4,6,20]);
:Name << Color Cells("Blue");
dt << Clear Select;

回覆:顏色單元格是的,好點。
回覆:顏色單元格根據如何使用它,有幾個選擇。 最簡單的選擇是從“文件”選單中開啟新的腳本文件

然後將腳本複製並貼上到將打開的窗口

檢查頂部「工具列」中的表格是否正確(如果開啟新腳本檔案時該表格最後處於活動狀態,則應該是正確的)。
然後按工具列中的“運行腳本”

如果必須重複執行此操作,您可以將該腳本製作為工具列項目、加載項、表格腳本、腳本文件......具體取決於用途
回覆:顏色單元格完美的! 感謝您的幫助。 對此,我真的非常感激。