ustalarım merhaba ben ufak çapta basit bir makine takip formu yapıyorum user formda bütün butonları yaptım ama birtek kaydet butonunu yapamadım girdiğim bilgileri kaydet butonuyla nasıl kaydedebilirim yardımcı olursanız çok sevinirim iyi çalışmalar
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Merhabaustalarım merhaba ben ufak çapta basit bir makine takip formu yapıyorum user formda bütün butonları yaptım ama birtek kaydet butonunu yapamadım girdiğim bilgileri kaydet butonuyla nasıl kaydedebilirim yardımcı olursanız çok sevinirim iyi çalışmalar
Private Sub CommandButton1_Click()
Dim son_sat As Long
Dim wks As Worksheet
Set wks = Worksheets("Sayfa1")
son_sat = wks.Range("A2").End(xlDown).Offset(1, 0).Row
If Trim(TextBox1.Value) = "" Then
MsgBox "Lütfen Makine Kodu Giriniz!", vbCritical
TextBox1.SetFocus
Exit Sub
End If
'girilen kayıtların sayfaya yazdırılması
With wks
.Cells(son_sat, 1) = TextBox1
.Cells(son_sat, 2) = ComboBox1
.Cells(son_sat, 3) = ComboBox2
.Cells(son_sat, 4) = ComboBox3
.Cells(son_sat, 5) = TextBox2
.Cells(son_sat, 7) = ComboBox4
.Cells(son_sat, 9) = Format((ComboBox5 & " " & ComboBox6 & " " & ComboBox7), "dd.mm.yyyy")
End With
Dim i As Integer, cbCount As Integer, cpt As String
cbCount = 0
For i = 0 To Me.Controls.Count - 1
If Left(Me.Controls(i).Name, 8) = "CheckBox" Then
If Me.Controls(i).Value = "True" Then
cpt = Me.Controls(i).Caption
wks.Cells(son_sat, 7) = wks.Cells(son_sat, 7) & " + " & cpt
End If
End If
Next i
wks.Cells(son_sat, 7) = Right(wks.Cells(son_sat, 7), Len(wks.Cells(son_sat, 7)) - 3)
'yeni kayıt için kutuların boşaltılması
TextBox1 = "": ComboBox1 = "": ComboBox2 = "": ComboBox3 = "": TextBox2 = ""
ComboBox4 = "": ComboBox5 = "": ComboBox6 = "": ComboBox7 = ""
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeName(ctrl) = "CheckBox" Then ctrl.Value = False
Next
TextBox1.SetFocus
End Sub