Created
August 23, 2015 11:40
-
-
Save kencoba/da6d08ecb45fac6de78d to your computer and use it in GitHub Desktop.
特定条件の行の,データが入力されているセルのみ強調表示する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Const 強調色 = 4 | |
Private Const 検索開始列 = 2 | |
Private Const 検索最終列 = 6 | |
Private Const 検索開始行 = 2 | |
Private Const 検索最終行 = 6 | |
Public Sub 強調表示_1件のみ() | |
Dim r As Range: Set r = Range(Cells(検索開始行, 検索開始列), Cells(検索最終行, 検索開始列)) | |
Dim c As Range | |
For Each c In r | |
Dim s As Range: Set s = Range(Cells(c.Row, c.Column), Cells(c.Row, 検索最終列)) | |
If WorksheetFunction.CountA(s) = 1 Then | |
Dim d As Range | |
For Each d In s | |
If d <> "" Then | |
d.Interior.ColorIndex = 強調色 | |
End If | |
Next d | |
End If | |
Next c | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment