Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Sütun_1 As String, Sütun_2 As String, X As Byte
If Application.CutCopyMode = xlCopy Or Application.CutCopyMode = xlCut Then Exit Sub
Range("D4:AB4").Interior.ColorIndex = 47
If Intersect(Target, [D:AB]) Is Nothing Then Exit Sub
If Target.Cells.Count = 16777216 Then Exit Sub
If InStr(1, Target.Address(0, 0), ":") > 0 Then
Sütun_1 = Split(Target.Address(0, 0), ":")(0)
Sütun_2 = Split(Target.Address(0, 0), ":")(1)
For X = 0 To 9
Sütun_1 = Replace(Sütun_1, X, "")
Sütun_2 = Replace(Sütun_2, X, "")
Next
If Cells(4, Sütun_1).Column < 4 And Cells(4, Sütun_2).Column > 28 Then
Range(Cells(4, "D"), Cells(4, "AB")).Interior.ColorIndex = 3
ElseIf Cells(4, Sütun_1).Column < 4 And Cells(4, Sütun_2).Column < 29 Then
Range(Cells(4, "D"), Cells(4, Sütun_2)).Interior.ColorIndex = 3
ElseIf Cells(4, Sütun_1).Column > 3 And Cells(4, Sütun_2).Column > 28 Then
Range(Cells(4, Sütun_1), Cells(4, "AB")).Interior.ColorIndex = 3
Else
Range(Cells(4, Sütun_1), Cells(4, Sütun_2)).Interior.ColorIndex = 3
End If
Else
If Target.Column > 3 Or Target.Column < 29 Then Cells(4, Target.Column).Interior.ColorIndex = 3
End If
End Sub
Bu kodu satırlar için uygulatmak istiyorum ama yapamadım yardımcı oalbilirmisiniz.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Sütun_1 As String, Sütun_2 As String, X As Byte
If Application.CutCopyMode = xlCopy Or Application.CutCopyMode = xlCut Then Exit Sub
Range("D4:AB4").Interior.ColorIndex = 47
If Intersect(Target, [D:AB]) Is Nothing Then Exit Sub
If Target.Cells.Count = 16777216 Then Exit Sub
If InStr(1, Target.Address(0, 0), ":") > 0 Then
Sütun_1 = Split(Target.Address(0, 0), ":")(0)
Sütun_2 = Split(Target.Address(0, 0), ":")(1)
For X = 0 To 9
Sütun_1 = Replace(Sütun_1, X, "")
Sütun_2 = Replace(Sütun_2, X, "")
Next
If Cells(4, Sütun_1).Column < 4 And Cells(4, Sütun_2).Column > 28 Then
Range(Cells(4, "D"), Cells(4, "AB")).Interior.ColorIndex = 3
ElseIf Cells(4, Sütun_1).Column < 4 And Cells(4, Sütun_2).Column < 29 Then
Range(Cells(4, "D"), Cells(4, Sütun_2)).Interior.ColorIndex = 3
ElseIf Cells(4, Sütun_1).Column > 3 And Cells(4, Sütun_2).Column > 28 Then
Range(Cells(4, Sütun_1), Cells(4, "AB")).Interior.ColorIndex = 3
Else
Range(Cells(4, Sütun_1), Cells(4, Sütun_2)).Interior.ColorIndex = 3
End If
Else
If Target.Column > 3 Or Target.Column < 29 Then Cells(4, Target.Column).Interior.ColorIndex = 3
End If
End Sub
Bu kodu satırlar için uygulatmak istiyorum ama yapamadım yardımcı oalbilirmisiniz.
