Hocam kodu ekledim.
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "4455"
If Len(TextBox3 & TextBox4 & TextBox8 & "") > 0 Then Debug.Print "en az biri dolu"
If TextBox1 = "" Then
MsgBox "...!!!.LÜTFEN TARİHİ GİRİNİZ.!!!...", vbInformation
Exit Sub: End If
If ComboBox3 = "" Then
MsgBox "...!!!.LÜTFEN AÇIKLAMA GİRİNİZ.!!!...", vbInformation
Exit Sub: End If
On Error Resume Next
ActiveSheet.ShowAllData
If ActiveSheet.AutoFilterMode Then ActiveSheet.Range("A1").AutoFilter Field:=1
On Error Resume Next
Dim i As Integer, ts
For i = 7 To 32000
If (ActiveSheet.Cells(i, 1) = "") Then
ActiveSheet.Cells(i, 2) = CDate(TextBox1)
ActiveSheet.Cells(i, 3) = TextBox2
ActiveSheet.Cells(i, 4) = ComboBox3
ActiveSheet.Cells(i, 5) = TextBox3.Text * 1
ActiveSheet.Cells(i, 6) = TextBox4.Text * 1
ActiveSheet.Cells(i, 7) = TextBox5.Text * 1
ActiveSheet.Cells(i, 8) = TextBox7.Text * 1
ActiveSheet.Cells(i, 9) = TextBox9.Text * 1
ActiveSheet.Cells(i, 10) = TextBox11.Text * 1
ActiveSheet.Cells(i, 11) = TextBox8.Text * 1
ts = Range("B" & Rows.Count).End(xlUp).Row
Range("A7") = 1
Range("A7:A" & ts).DataSeries rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Step:=1, Trend:=False
MsgBox "KAYIT YAPILDI!...", vbOKOnly + vbInformation, "Bilgi Ekleme"
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$" & [A65536].End(3).Row
Range("A65535").End(xlUp).Offset(1, 0).Select
ThisWorkbook.Save
TextBox1.SetFocus
'Unload Me
'UserForm1.Show
TextBox1.Text = CDate(Date) 'Form Açılışta otomatik tarih
'On Error Resume Next
Me.ComboBox3 = ""
Me.TextBox2 = ""
Me.TextBox3 = ""
Me.TextBox4 = ""
Me.TextBox5 = ""
Me.TextBox6 = ""
Me.TextBox7 = ""
Me.TextBox8 = ""
Me.TextBox9 = ""
Me.TextBox10 = ""
Me.TextBox11 = ""
Exit For
End If
Next
ActiveSheet.Protect "4455"
UserForm_Initialize
ListBox1.ListIndex = [A65536].End(3).Row - 1 'LİSTBOX A SON BOŞ SATIR EKLER
ListBox1.ListIndex = ListBox1.ListCount - 1 'ListBoxın son satırına gider.'
Range("A65535").End(xlUp).Offset(1, 0).Select 'Son boş satıra gider
Exit Sub
End Sub
Hocam Dosyayı da ekliyorum.
Per.Çiz.rar
(Dosya Boyutu: 277,93 KB | İndirme Sayısı: 2)