メインコンテンツへスキップ

Googleスプレッドシートのセルの色に基づいて行をフィルタリングするにはどうすればよいですか?

通常、Excelではフィルター機能を使用して特定の色で行をすばやくフィルター処理できますが、Googleスプレッドシートでは、フィルター機能はこの操作をサポートしていません。 この記事では、Googleスプレッドシートで行を色でフィルタリングする方法について説明します。

Googleシートの色に基づいて行をフィルタリングする


Googleシートの色に基づいて行をフィルタリングする

次の手順を適用して、色に基づいてデータをフィルタリングしてください。

1に設定します。 OK をクリックします。 ツール > スクリプトエディタ、スクリーンショットを参照してください:

2。 開いたプロジェクトウィンドウで、以下のスクリプトコードをコピーして貼り付け、コードモジュールの元のコードを置き換えてください。スクリーンショットを参照してください。

function getHex(input) {
  return SpreadsheetApp.getActiveSpreadsheet().getRange(input).getBackgrounds();
}

3。 次に、コードウィンドウを保存すると、プロジェクトに名前を付けるように促すプロンプトボックスが表示されます。スクリーンショットを参照してください。

4。 スクリプトコードを保存した後、シートに戻り、次の式を入力します。 = getHex( "A2:A16") データ範囲の横の空白のセルに入力し、を押します 入力します キーを押すと、各行のカラーインデックスがヘルパー列に表示されます。スクリーンショットを参照してください。

5。 次に、このヘルパー列に基づいて行をフィルタリングする必要があります。ヘルパー列ヘッダーをクリックしてから、をクリックしてください。 且つ > フィルタ、スクリーンショットを参照してください:

6。 次に、ヘルパー列のドロップダウンボタンをクリックし、展開されたペインで、リストボックスからフィルタリングするカラーインデックスを選択してチェックします。スクリーンショットを参照してください。

7。 クリック OK ボタンをクリックすると、特定のセルの色で塗りつぶされた行が次のスクリーンショットのようにフィルタリングされます。

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
See also how-to-pass-a-range-into-a-custom-function-in-google-spreadsheets
https://webapps.stackexchange.com/questions/10629/how-to-pass-a-range-into-a-custom-function-in-google-spreadsheets

This then gives for example

=getHex(CELL("address",A1))
=getHex(CELL("address",A1)&":"&CELL("address",A2))

etc
This comment was minimized by the moderator on the site
What if only certain cells in a row were colored? How can I use this method to notate which ROWS contain a particular color?
This comment was minimized by the moderator on the site
It worked for me, but not for alle colors. I don't know why.
But anyway: Thank a lot!
This comment was minimized by the moderator on the site
ty it works
This comment was minimized by the moderator on the site
Thanks a lot! It helped.
This comment was minimized by the moderator on the site
Superb! very useful! Thanks a million! Cheers!
This comment was minimized by the moderator on the site
Thank you. Awesome
This comment was minimized by the moderator on the site
there's a question that it kept showing "Range not found",how can i fix it
This comment was minimized by the moderator on the site
Awesome job, it works exactly like the explanation.Thank you
This comment was minimized by the moderator on the site
Great workaround! I tried repeatedly to highlight duplicates in an Excel spreadsheet then sort by cell color but since the file was so large (373K + rows) the sort would "hang", and never complete. I decided to try Google Sheets and although I could only format about 100K rows at a time (had to do a format 4x) your workaround worked perfectly. Plus, scrolling down the page with Google Sheets was infinitely faster than with Excel. Thanks for the great hack!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations