依公式指定格式

函式 STYLE() 可以新增到儲存格中現有的公式上。若與函式 CURRENT 一起使用,便可以將儲存格依其數值標上顏色。例如在公式 =...+STYLE(IF(CURRENT()>3; "Red"; "Green")) 中,當該儲存格的數值大於 3 時,便會套用「紅色」儲存格樣式,否則便套用「綠色」儲存格樣式。

若要對所選區塊中所有的儲存格套用某個公式,可以使用 [尋找與取代] 對話方塊。

  1. 選取全部所需儲存格。

  2. 選取功能表指令[編輯] - [搜尋和代替]

  3. For the Find term, enter: .*

    「.*」是一種常規表達式,指代目前儲存格的內容。

  4. Enter the following formula in the Replace field: =&+STYLE(IF(CURRENT()>3;"Red";"Green"))

    The "&" symbol designates the current contents of the Find field. The line must begin with an equal sign, since it is a formula. It is assumed that the cell styles "Red" and "Green" already exist.

  5. 標記[常規表達][只允許目前的選取]等欄位。按一下[搜尋全部]

    所有於選取內包含內容的儲存格均會標明出來。

  6. 按一下 [開啟舊檔]