hücre rengi aktif olması

Katılım
1 Ağustos 2006
Mesajlar
179
Altın Üyelik Bitiş Tarihi
22-08-2024
merhabalar satır seçiyor ançak hücrenin içini başka renk nasıl yapabilirim

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
Cells.FormatConditions.Delete
If Intersect(ActiveCell, [A2:T9999]) Is Nothing Then Exit Sub
Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row).FormatConditions.Add Type:=xlExpression, Formula1:=1
Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row).FormatConditions(1).Interior.Color Index = 36
Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row).FormatConditions(1).Font.Bold = True
Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row).FormatConditions(1).Font.ColorIndex = 5


ActiveCell.FormatConditions.Add Type:=xlExpression, Formula1:=1
ActiveCell.FormatConditions(1).Interior.ColorIndex = 15

End Sub
 

systran

Destek Ekibi
Destek Ekibi
Katılım
15 Aralık 2007
Mesajlar
1,573
Excel Vers. ve Dili
2007 [TR], 2013 [TR]
illaki koşullu biçimlendirme olmayacaksa şu kodu deneyin. önce sayfadaki koşullu biçimlendirmeleri silmeyi unutmayınız.

Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(ActiveCell, [A2:T9999]) Is Nothing Then Exit Sub
Range("A2:T9999").Interior.ColorIndex = -4142
Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row).Interior.ColorIndex = 1
ActiveCell.Interior.ColorIndex = 3
End Sub
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,245
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Deneyin.

ThisWorkbook bölümüne uygulayın. (BuÇalışmaKitabı)

Kod:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Cells.FormatConditions.Delete
    If Intersect(ActiveCell, [A2:T9999]) Is Nothing Then Exit Sub
    Adres = "A" & Target.Row & ":T" & Target.Row
    With Range(Adres)
        .FormatConditions.Add Type:=xlExpression, Formula1:=1
        .FormatConditions(1).Interior.ColorIndex = 15
        .FormatConditions(1).StopIfTrue = False
    End With
    
    With ActiveCell
        .FormatConditions.Delete
        .FormatConditions.Add Type:=xlExpression, Formula1:=1
        .FormatConditions(1).Interior.ColorIndex = 17
        .FormatConditions(1).StopIfTrue = False
    End With
End Sub
 
Üst