Office
 Computer >> コンピューター >  >> ソフトウェア >> Office

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

この記事では、Excel で 1 行おきに強調表示する方法について説明します。 . 条件付き書式を適用する利用可能なテクニック 、さまざまなテーブル スタイルを使用 、Excel の適用 VBA コード。 Excel で別の行を強調表示することをお勧めします 読みやすくするために。小さなテーブルでさまざまな行を手動で強調表示するのは、非常に簡単な作業です。しかし、ワークシートで大きなテーブルを処理する必要がある場合は、別のアプローチを課す必要があります.

Excel で 1 行おきに強調表示する 3 つの適切な方法

Excel があるとします。 複数の営業担当者に関する情報を含む大きなワークシート アルマーニ グループの . 商品の名前 と製品 IDD に記載されています 、および C それぞれ。 条件付き書式設定を使用して、Excel で 1 行おきに強調表示します。 司令部、ISEVEN ISODD MOD 関数、および VBA コードも。これが、今日のタスクのデータセットの概要です。

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

1.表スタイルを適用して 1 行おきに強調表示する

Excel でさまざまな行の網かけを適用するには、さまざまなテーブル スタイルを使用できます。これは、行を強調表示するための最も簡単で最速の方法です。デフォルトの自動フィルタリングとカラー バンディングにより、Excel でさまざまな行を簡単に強調表示できます。行の強調表示を実行するには、データ範囲を選択してテーブルに変換する必要があります。

表のオプションとして、行と列の強調表示に使用できるカラー ストライプの数が非常に多くあります。行のシェーディングは、さまざまな色のストライプに対して次の手順に従って行うことができます。以下の手順に従って学習しましょう!

ステップ 1:

  • まず、データ範囲 B4 を選択します E16 へ .
  • したがって、挿入から タブ、移動、

挿入

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • その結果、Create Table ダイアログボックスが表示されます。 テーブルの作成から ダイアログ ボックスで、OK を押します .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • その後、ハイライトのデフォルト色で表を作成できるようになります。

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

ステップ 2:

  • Excel は 青色 を生成します そして デフォルトのパターン テーブル .テーブルに独自のカラーパターンを作成したい場合は、それも可能です。このためには、テーブルをフォーマットする必要があります。これを行うには、[テーブルとしてフォーマット] をクリックします。 スタイル からのオプション ホームの下のグループ より多くのパターンと色が見つかります。

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • したがって、作成した表のデフォルトのハイライト色を変更できます。 デザイン も使用できます オプションをスプレッドシートの一番上に配置すると、色のオプションとテーブル スタイルのオプションが表示されます。

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

2.条件付き書式を使用して 1 行おきに強調表示する

条件付き書式 特定の行をハイライトまたはシェーディングするのに適しています。 条件付き書式の助けを借りて 、選択に応じてさまざまな行を強調表示できます。ここでは、行を強調表示するための条件付き書式で 2 つの数式を使用しています。

2.1 ISEVEN 関数の適用

ISEVEN 関数の使用 条件付き書式で 特定の範囲の偶数行を強調表示できます。たとえば、範囲 A1:D9 の偶数行を強調表示する場合は、範囲全体を選択して、[新しいルール] を選択します。 条件付き書式の下 この式 =ISEVEN(ROW()) を使用します。 手順は次のとおりです。

手順:

  • まず、B5 からセルを選択します B16へ 条件付き書式を適用します。次に、 ホーム から タブ、移動、

ホーム → スタイル → 条件付き書式 → 新しいルール

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • New Formatting Rule という名前のダイアログ ボックス 現れる。 新しいフォーマット ルールの手順に従います ダイアログボックス。まず、[数式を使​​用して書式設定するセルを決定する] を選択します。 ルール タイプの選択: から 次に、以下の式を [この式が真である場合の値の書式設定] に記述します:. ISEVEN 機能は、
=ISEVEN(ROW())
  • したがって、フォーマットを押してください オプション

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • フォーマットをクリックした後 オプション、セルの書式設定 ダイアログボックスがポップアップします。そのダイアログ ボックスから、まず 塗りつぶし を選択します。 次に、背景色から任意の色を選択します メニュー。 濃い黄色を選択しました .最後に、[OK] をクリックします .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • したがって、新しい書式設定ルールに戻ります ダイアログボックス。最後に、[OK] をクリックする必要があります .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • 最後に、1 行おきにハイライトできるようになります それは下のスクリーンショットに示されています。

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

2.2 ISODD 関数を使用してすべての奇数行を強調表示する

ISODD の使用 条件付き書式の関数を使用すると、特定の範囲の奇数行を強調表示できます。たとえば、範囲 B5:E16 の奇数行を強調表示する場合 、範囲全体を選択し、新しいルールを選択します 条件付き書式の下 この数式を使用します =ISODD(ROW()). 手順は次のとおりです。

手順:

  • まず、B5 からセルを選択します B16へ 条件付き書式を適用します。次に、 ホーム から タブ、移動、

ホーム → スタイル → 条件付き書式 → 新しいルール

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • New Formatting Rule という名前のダイアログ ボックス 現れる。 新しいフォーマット ルールの手順に従います ダイアログボックス。まず、[数式を使​​用して書式設定するセルを決定する] を選択します。 ルール タイプの選択: から 次に、以下の式を この式が真である場合の値の書式設定 に記述します:. ISODD 機能は、
=ISODD(ROW())
  • したがって、フォーマットを押してください オプション

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • フォーマットをクリックした後 オプション、セルの書式設定 ダイアログボックスがポップアップします。そのダイアログ ボックスから、まず [塗りつぶし] を選択します。 次に、背景色から任意の色を選択します メニュー。 を選択しました 色。最後に、[OK] をクリックします .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Hence, you will go back to the New Formatting Rule ダイアログボックス。 Finally, you have to click OK .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Finally, you will be able to highlight every odd row that has been given in the below screenshot.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

2.3 Formatting in Group Using Multiple Functions in a Single Formula

Suppose you need to highlight every other row in a group. You can apply conditional formatting with a formula based on the ISEVEN/ISODD , CEILING , and ROW functions to perform this highlighting. To do that, simply repeat sub-method 1. You can only change the below formula in the New Formatting Rule dialog box to highlight every other row,

=ISEVEN(CEILING(ROW()-1,2/2)

数式の内訳:

The formula 1 st normalized the row numbers for beginning with 1 using the ROW function and an offset. Here, we used the offset as 1 . The result then goes to the CEILING function , which rounds the result by multiplying 2. Then it is divided by 2 to count as a group of 2 , which starts with 1 . Finally, to show the TRUE result in the even row groups the ISEVEN function is taken in the formula. We can also use the ISODD function instead of ISEVEN . Based on the formula and numbers stated in the formula the output will be different.

  • The pictures below show the result that we discussed in this example.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

2.4 Combine MOD and ROW Functions to Highlight Rows

Instead of the ISEVEN/ISODD function, we can also use the MOD function to highlight different rows. Like the ISEVEN/ISODD function, this formula also determines whether a row is even or odd-numbered, and then applies the shading accordingly. To highlight every even row, simply repeat sub-method 1. You can only change the below formula in the New Formatting Rule dialog box to highlight every even row,

=MOD(ROW(),2)=0

数式の内訳:

The MOD function carries a number with a divisor and returns a number as a remainder. Here the number is provided by the ROW function which is then divided by 2 . If the number is even, MOD returns 0 .

  • The following pictures show the highlighted even rows.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • If you want to highlight the odd rows using the same formula, you can just use a 1 instead of 0 in the above formula. The result and formula stated in the conditional formatting are shown in the below pictures.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • After that, select the Format option to highlight every odd row. We will highlight every odd row with Red color.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

注:

The divisor cannot be zero or one. If zero is used as a divisor no shading will be found in the range, and one is used as a divisor the whole range will be shaded.

If you want to highlight every 2 rows which start from the 1st group, the formula will be =MOD(ROW()-2,4)+1<=2

Again If you want to highlight every 2 rows which start from the 2nd group, the formula will be =MOD(ROW()-2,4)>=2, and to highlight every 3 rows which start from the 2nd group, the formula will be =MOD(ROW()-3,6)>=3.

3. Run VBA Code to Highlight Every Other Row

For highlighting different rows in excel we can also use the VBA code. Here in this example, we used a VBA code that highlights the even rows. Let’s follow the instructions below to highlight the even rows!

ステップ 1:

  • First of all, open a Module, to do that, firstly, from your Developer tab, go to,

Developer → Visual Basic

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • After clicking on the Visual Basic ribbon, a window named Microsoft Visual Basic for Applications – Highlight Every Other Row.xlsm will instantly appear in front of you. From that window, we will insert a module for applying our VBA code . To do that, go to,

Insert → Module

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

ステップ 2:

  • Hence, the Highlight Every Other Row module pops up. In the Highlight Every Other Row module, write down the below VBA
Sub Highlight_Every_Other_Row()
Dim R As Range, x
On Error Resume Next
Set R = Application.InputBox("Select Range", Type:=8)
For x = 1 To R.Rows.Count
 If x Mod 2 = 0 Then
 R.Rows(x).Interior.ColorIndex = 15
 End If
Next
End Sub

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Hence, run the VBA To do that, go to,

Run → Run Sub/UserForm

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • After running the VBA Code , an Input dialog box pops up. From the Input dialog box, do like the below screenshot.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Finally, you will be able to highlight every even row which has been given in the below screenshot.

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

Select Every Other Row in Excel

In this section, we will learn how to select every other row in Excel. The easiest and shortest way to select every other row is by using the keyboard and mouse. Let’s follow the instructions below to learn!

手順:

  • First, select the row number then double click on the row number by the right side of the mouse.

<強い> Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Then, it will select the Entire Row .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

  • Now, hold the CTRL key and select the rest of the rows of your choice using the right side of the mouse .

Excel で 1 行おきに強調表示する方法 (3 つの簡単な方法)

覚えておくべきこと

👉 You can also pop up Microsoft Visual Basic for Applications window by pressing Alt + F11 simultaneously on your keyboard.

👉 If a Developer tab is not visible in your ribbon, you can make it visible. To do that, go to,

File → Option → Customize Ribbon

結論

In this article, we can see different methods to highlight every other row in Excel. Shading/Highlighting different rows in excel improve readability and legibility. While working on a big spreadsheet, it is better to highlight rows.

Hopefully, from now you won`t have any problems while applying color banding in different rows of Excel. This article may help you with the question of how to highlight every other row in excel. If you have applied any other approach to highlight rows, please don’t hesitate to leave a comment.

関連記事

  • Data Clean-up Techniques in Excel:Randomizing the Rows
  • How to Delete Blank Rows in Excel (6 Ways)
  • Highlight Row If Cell Contains Any Text
  • How to Highlight Row If Cell Is Not Blank (4 Methods)

  1. Excel で依存関係をトレースする方法 (2 つの簡単な方法)

    Excel で作業中 、依存関係を追跡する方法を知ることが重要です 一連のデータで。 依存関係を追跡することを知る のデータが Excelに役立ちます ユーザーは、セル内のデータが他のセルにどのように依存しているかを知ることができます。 扶養家族の追跡 エクセルで 必要なときにワークブックを便利にします。この記事では、依存関係を追跡する方法を学びます。 エクセルで 2 つの簡単で便利な方法で。 練習用ワークブックをダウンロードして練習してください。 Excel で依存関係を追跡する 2 つの簡単な方法 ABC Traders の半年売上高のデータセットを見てみましょう .データセットは 3

  2. XML を Excel テーブルに変換する方法 (3 つの簡単な方法)

    XML の変換が必要になる場合があります Excel テーブルに .この記事では、XML の変換方法について説明します。 Excel テーブル に Microsoft 365 バージョンを使用 . ここから練習用ワークブックをダウンロードできます: XML ファイルとは XML ファイルには、さまざまなアプリケーションやシステムで読み取り可能な形式でデータを保存できます。基本的に、XML Extensible Markup Language の略 .実際、ユーザーは XML を読むことができません 簡単にファイルします。そのため、別の形式に抽出する必要があります。さらに、XML ファイ