是只要A欄和B欄有值,然後從編輯的那一行A到K都變色對嗎?只要改紅字的部份就可以了
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 And Target.Row > 1 And Cells(Target.Row, "B") <> "" And Cells(Target.Row, "A") <> "" Then
Set col = Sheets("公司清單").Columns(2).Find(Cells(Target.Row, 2), , , , , 2)
AA = col.Offset(0, 1).Interior.Color
Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = _
col.Offset(0, 1).Interior.Color
Else
Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = 16777215
End If
End Sub作者: leirex1201 時間: 2015-5-11 15:42
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 11 And Target.Row > 1 And Cells(Target.Row, "B") <> "" And Cells(Target.Row, "A") <> "" Then
Set col = Sheets("公司清單").Columns(2).Find(Cells(Target.Row, 2), , , , , 2)
AA = col.Offset(0, 1).Interior.Color
Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = _
col.Offset(0, 1).Interior.Color
End If
End Sub作者: leirex1201 時間: 2015-5-11 15:49