DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[B]Private Sub CommandButton3_Click()[/B]
TextBox1 = Format(Date, "dd.mm.yyyy")
If TextBox1.Value = "" Then
MsgBox ("Sayfa ismi boş geçilemez! Lütfen sayfa ismi yazınız.")
Exit Sub
End If 'textboxu boş geçmeme
Dim s As Integer
For s = Sheets.Count To 1 Step -1
If Len(Sheets(s).Name) = 10 Then
If IsDate(Sheets(s).Name) And ([B][COLOR="Red"]Month(Date) - Month(CDate(Sheets(s).Name)) > 1[/COLOR][/B] Or CDate(Sheets(s).Name) > Date) Then
Application.DisplayAlerts = False
Sheets(s).Delete
Application.DisplayAlerts = True
End If
End If
Next
Dim S1 As Worksheet
If TextBox1 = "" Then
MsgBox "Lütfen sayfa ismi giriniz!", vbCritical
TextBox1.SetFocus
Exit Sub
End If
On Error Resume Next
Set S1 = Sheets(TextBox1.Text)
On Error GoTo 0
If S1 Is Nothing Then
Sheets("ŞABLON").Copy After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = TextBox1.Text
Else
MsgBox TextBox1.Text & " isimli sayfa daha önce eklenmiş!", vbCritical
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = (Len(.Text))
End With
End If
Set S1 = Nothing
' MsgBox "Sayfa oluşturuldu."
[B]End Sub[/B]
[B]Sub SIRALA()[/B]
Dim sayfa As Variant
Dim syf As Variant
Application.ScreenUpdating = False
For Each sayfa In ActiveWorkbook.Sheets
For syf = 2 To ActiveWorkbook.Sheets.Count
On Error Resume Next
If CDate(Sheets(syf - 1).Name) > CDate(Sheets(syf).Name) Then
Sheets(syf - 1).Move After:=Sheets(syf)
End If
Next
Next
Application.ScreenUpdating =True
[B]End Sub[/B]