Created
June 29, 2012 11:17
-
-
Save yatemmma/3017405 to your computer and use it in GitHub Desktop.
条件付き書式で指定行とdiff
This file contains 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
Sub 条件付き書式で指定行とdiff() | |
Dim rowNum As Integer | |
rowNum = InputBox("比較対象は何行上?", "", "") | |
setFormatConditions rowNum | |
End Sub | |
Function setFormatConditions(rowNum As Integer) | |
Selection.FormatConditions.Delete | |
char = Split(Selection(1).Address, "$")(1) | |
Dim self, target As String | |
self = char & Selection(1).Row | |
target = char & Selection(1).Row - rowNum | |
frmla = "=" & target & "<>" & self | |
Selection.FormatConditions.Add Type:=xlExpression, Formula1:=frmla | |
SelectionFormatConditions(1).Interior.ColorIndex = 26 | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment