Skip to main content

AccessTr.neT


Tarihe Göre Renk Atama

Tarihe Göre Renk Atama

#8
Merhaba;
Aşağıdaki kodu dener misiniz? 
Yapmak istediğinizi doğru anladıysam sanırım oldu, umarım işinize yarar.
İyi çalışmalar.
Dim dolu_sutun, i, d, x, y As Integer
dolu_sutun = WorksheetFunction.CountA(Range("1:1"))
dolu_satir = WorksheetFunction.CountA(Range("A:A"))

For x = 2 To dolu_satir
     For y = 5 To dolu_sutun
        If WorksheetFunction.Weekday(Cells(1, y), vbMonday) > 5 Then
           Cells(x, y).Interior.Color = 11005
        End If
    Next y
Next x

For d = 2 To dolu_satir Step 5
   For i = 5 To dolu_sutun
      If WorksheetFunction.Weekday(Cells(1, i), vbMonday) = 1 Then
           Cells(d, i).Interior.Color = 65535
           Cells(d, i) = "T"
      ElseIf WorksheetFunction.Weekday(Cells(1, i), vbMonday) = 2 Then
           Cells(d + 1, i).Interior.Color = 65535
           Cells(d + 1, i) = "T"
       ElseIf WorksheetFunction.Weekday(Cells(1, i), vbMonday) = 3 Then
           Cells(d + 2, i).Interior.Color = 65535
           Cells(d + 2, i) = "T"
       ElseIf WorksheetFunction.Weekday(Cells(1, i), vbMonday) = 4 Then
           Cells(d + 3, i).Interior.Color = 65535
           Cells(d + 3, i) = "T"
       ElseIf WorksheetFunction.Weekday(Cells(1, i), vbMonday) = 5 Then
           Cells(d + 4, i).Interior.Color = 65535
           Cells(d + 4, i) = "T"
       End If
   Next i
Next d
   MsgBox "GÜNLÜK İZİNLER VE HAFTA SONLARI GÖSTERİLDİ.....!!!!!"
Range("A1").Select
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Tarihe Göre Renk Atama - Yazar: arif1971 - 17/12/2017, 20:49
Cvp: Tarihe Göre Renk Atama - Yazar: direnist - 18/12/2017, 16:01
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 18/12/2017, 20:38
Cvp: Tarihe Göre Renk Atama - Yazar: direnist - 18/12/2017, 23:23
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 20/12/2017, 19:45
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 19/12/2017, 17:39
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 19/12/2017, 23:07
Cvp: Tarihe Göre Renk Atama - Yazar: direnist - 21/12/2017, 00:11
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 22/12/2017, 11:53
Cvp: Tarihe Göre Renk Atama - Yazar: direnist - 22/12/2017, 16:00
Cvp: Tarihe Göre Renk Atama - Yazar: arif1971 - 22/12/2017, 16:16