20260515指摘対応2

This commit is contained in:
guanxiangwei
2026-05-15 16:59:40 +09:00
parent 5930d49cf2
commit fa8bd26757
2 changed files with 16 additions and 0 deletions

View File

@@ -329,6 +329,22 @@ Function CheckHeaderEdit(ByVal ws As Worksheet, ByVal Target As Range) As Boolea
End If
Next r
' filterRow color is not equals to filterRow + 1
If Target.Row = filterRow + 1 Then
Dim firstCell As Range: Set firstCell = Target.Cells(1, 1)
Dim colIndex As Long: colIndex = firstCell.Column
Dim refCell As Range: Set refCell = ws.Cells(filterRow, colIndex)
If firstCell.Interior.Color = refCell.Interior.Color Then
Application.EnableEvents = False
MsgBox "Cannot autoFill from filterRow.", vbExclamation
Application.Undo
Application.EnableEvents = True
CheckHeaderEdit = True
Exit Function
End If
End If
CheckHeaderEdit = False
End Function