- Katılım
- 22 Mayıs 2009
- Mesajlar
- 1,017
- Excel Vers. ve Dili
- Office 2003
rivate Sub Worksheet_Change(ByVal Target As Range)
Dim i As Date, ilk As Date, son As Date, sut As Byte
If Intersect(Target, [E5:E6]) Is Nothing Then Exit Sub
On Error Resume Next
ilk = DateSerial(Range("E5").Value, WorksheetFunction.Match(Range("E6").Value, Range("B5:B16"), 0), 1)
son = DateSerial(Year(ilk), Month(ilk) + 1, 0)
sut = 8
Range("H10:AH22").Interior.ColorIndex = xlNone
Range("H10:AH22").Font.ColorIndex = vbBlack
Range("H10:AH2").Font.Bold = False
For i = ilk To son
Cells(10, sut).Value = i
If Weekday(Cells(10, sut).Value, 2) = 7 Then
Range(Cells(10, sut), Cells(99, sut)).Interior.Color = vbRed
Range(Cells(10, sut), Cells(99, sut)).Font.Color = vbYellow
Range(Cells(10, sut), Cells(99, sut)).Font.Bold = True
End If
sut = sut + 1
Next
End Sub
Yukarıdaki kod Evren Gizlen üstadıma ait.Sitede yardım için müracaat ettik. Sağolsun Hemen işimizi gördü. Şimdi de bir ekleme istiyorum yukarıda ki koda. Kod şuan için PAZAR gününü renklendiriyor.CUMARTESİ gününü de ekleyerek renklendirebilir miyiz? Ama kodda ki hücre değerleri değişmesin
Dim i As Date, ilk As Date, son As Date, sut As Byte
If Intersect(Target, [E5:E6]) Is Nothing Then Exit Sub
On Error Resume Next
ilk = DateSerial(Range("E5").Value, WorksheetFunction.Match(Range("E6").Value, Range("B5:B16"), 0), 1)
son = DateSerial(Year(ilk), Month(ilk) + 1, 0)
sut = 8
Range("H10:AH22").Interior.ColorIndex = xlNone
Range("H10:AH22").Font.ColorIndex = vbBlack
Range("H10:AH2").Font.Bold = False
For i = ilk To son
Cells(10, sut).Value = i
If Weekday(Cells(10, sut).Value, 2) = 7 Then
Range(Cells(10, sut), Cells(99, sut)).Interior.Color = vbRed
Range(Cells(10, sut), Cells(99, sut)).Font.Color = vbYellow
Range(Cells(10, sut), Cells(99, sut)).Font.Bold = True
End If
sut = sut + 1
Next
End Sub
Yukarıdaki kod Evren Gizlen üstadıma ait.Sitede yardım için müracaat ettik. Sağolsun Hemen işimizi gördü. Şimdi de bir ekleme istiyorum yukarıda ki koda. Kod şuan için PAZAR gününü renklendiriyor.CUMARTESİ gününü de ekleyerek renklendirebilir miyiz? Ama kodda ki hücre değerleri değişmesin
