• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

hücre rengi aktif olması

  • Konbuyu başlatan Konbuyu başlatan koboy
  • Başlangıç tarihi Başlangıç tarihi
Katılım
1 Ağustos 2006
Mesajlar
179
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
 
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
 
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
 
Geri
Üst