- Katılım
- 30 Temmuz 2010
- Mesajlar
- 4
- Excel Vers. ve Dili
- 2003 ingilizce
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Private Sub Worksheet_Activate()
Dim BUL As Range, ADRES As String, SAY As Byte
If Date >= DateSerial(Year(Date), Month(Date), 28) And Date <= DateSerial(Year(Date), Month(Date) + 1, 0) Then
Set BUL = Range("B:B").Find(DateSerial(Year(Date), Month(Date), 28))
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
If InStr(1, BUL.Offset(0, 1), "MAAS") > 0 Then SAY = SAY + 1
Set BUL = Range("B:B").FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
If SAY = 0 Then
If MsgBox("Maaş bilgisini otomatik eklemek ister misiniz?", vbCritical + vbYesNo, "Dikkat !") = vbYes Then
Range("B65536").End(3).Offset(1) = DateSerial(Year(Date), Month(Date), 28)
Range("B65536").End(3).Offset(0, 1) = UCase(Replace(Replace(Format(DateSerial(Year(Date), Month(Date) - 1, 1), "mmmm"), "ı", "I"), "i", "İ") & " MAASI")
Range("B65536").End(3).Offset(0, 3) = 1000
Range("B65536").End(3).Offset(0).Resize(1, 4).Interior.ColorIndex = 15
End If
End If
End If
If Day(Date) >= 1 And Day(Date) <= 15 Then
Set BUL = Range("B:B").Find(DateSerial(Year(Date), Month(Date) - 1, 28))
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
If InStr(1, BUL.Offset(0, 1), "MAAS") > 0 Then SAY = SAY + 1
Set BUL = Range("B:B").FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
If SAY = 0 Then
If MsgBox("Maaş bilgisini otomatik eklemek ister misiniz?", vbCritical + vbYesNo, "Dikkat !") = vbYes Then
Range("B65536").End(3).Offset(1) = DateSerial(Year(Date), Month(Date) - 1, 28)
Range("B65536").End(3).Offset(0, 1) = UCase(Replace(Replace(Format(DateSerial(Year(Date), Month(Date) - 1, 1), "mmmm"), "ı", "I"), "i", "İ") & " MAASI")
Range("B65536").End(3).Offset(0, 3) = 1000
Range("B65536").End(3).Offset(0).Resize(1, 4).Interior.ColorIndex = 15
End If
End If
End If
End Sub
Selamlar,
Kod bu haliyle istediğiniz şekilde uyarmaz.
Selamlar,
Hangi tarihler arası kontrol yapılacak?