AccessTr.neT
Hücre seçildiğinde renkle doldurma - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Excel (https://accesstr.net/forum-microsoft-excel.html)
+--- Forum: Excel Cevaplanmış Soruları (https://accesstr.net/forum-excel-cevaplanmis-sorulari.html)
+--- Konu Başlığı: Hücre seçildiğinde renkle doldurma (/konu-hucre-secildiginde-renkle-doldurma.html)



Hücre seçildiğinde renkle doldurma - Conqueror20 - 15/01/2014

iyi akşamlar,
ekteki dosyada
b2 hücresi seçilirse f2:p2 hücresini mavi
b3 hücresi seçilirse f3:p3 hücresini mavi
b4 hücresi seçilirse f4:p4 hücresini mavi yapmak istiyorum


Cvp: Hücre seçildiğinde renkle doldurma - Conqueror20 - 15/01/2014

arkadaşlar yokmu yardım edecek


Cvp: Hücre seçildiğinde renkle doldurma - ogulcan92 - 12/03/2014

Sn:Conqueror20
Aşağıdaki kodu kullanabilirsiniz.
Function InRange(Range1 As Range, Range2 As Range) As Boolean
Dim InterSectRange As Range
Set InterSectRange = Application.Intersect(Range1, Range2)
InRange = Not InterSectRange Is Nothing
Set InterSectRange = Nothing
End Function

Sub ColourChange()
If InRange(ActiveCell, Range("B2:B65536")) Then
Cells.Interior.ColorIndex = xlNone
Range("F" & ActiveCell.Row, "P" & ActiveCell.Row).Interior.ColorIndex = 4
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call ColourChange
End Sub