DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "Yapılan İş"
.AddItem "Masraf"
End With
End Sub
Private Sub CommandButton1_Click()
Dim s1 As Worksheet, son As Long, say As Byte, sor As Byte
Set s1 = Sheets(ComboBox1.Text)
With s1
son = .Cells(Rows.Count, 1).End(3).Row + 1
say = WorksheetFunction.CountIf(.Range("B2:B" & son), TextBox2.Value)
If say > 1 Then
sor = MsgBox(TextBox2.Value & " Kaydı var! Kayıt yapılsın mı?", vbQuestion + vbYesNo, "Mükerrer Kayıt")
If sor = vbNo Then
Exit Sub
Else
.Cells(son, 1) = CDate(TextBox1.Value)
.Cells(son, 2) = TextBox2.Value
.Cells(son, 3) = TextBox3.Value
.Cells(son, 3).NumberFormat = "#,##0.00"
End If
Else
.Cells(son, 1) = CDate(TextBox1.Value)
.Cells(son, 2) = TextBox2.Value
.Cells(son, 3) = TextBox3.Value
.Cells(son, 3).NumberFormat = "#,##0.00"
End If
End With
End Sub
Rica ederim.
[/QUOT
üstadım userform daki tarih bölümüne çift tıklayınca günün tarihini yazdıramadım ve onay verince userformda bilgilersilinmiyor yardım edersen sevinirim
Private Sub CommandButton1_Click()
Dim s1 As Worksheet, son As Long, say As Byte, sor As Byte
If ComboBox1.Value = Empty Then
MsgBox "Sayfa seçimi yapmadınız!", vbExclamation, ""
Exit Sub
End If
Set s1 = Sheets(ComboBox1.Text)
With s1
son = .Cells(Rows.Count, 1).End(3).Row + 1
say = WorksheetFunction.CountIf(.Range("B2:B" & son), TextBox2.Value)
If say >= 1 Then
sor = MsgBox(TextBox2.Value & " Kaydı var! Kayıt yapılsın mı?", vbQuestion + vbYesNo, "Mükerrer Kayıt")
If sor = vbNo Then
temizle
Exit Sub
Else
.Cells(son, 1) = CDate(TextBox1.Value)
.Cells(son, 2) = TextBox2.Value
.Cells(son, 3) = TextBox3.Value
.Cells(son, 3).NumberFormat = "#,##0.00"
End If
Else
.Cells(son, 1) = CDate(TextBox1.Value)
.Cells(son, 2) = TextBox2.Value
.Cells(son, 3) = TextBox3.Value
.Cells(son, 3).NumberFormat = "#,##0.00"
End If
End With
temizle
End Sub
Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Text = CDate(Date)
End Sub
Sub temizle()
Dim nesne As Object
For Each nesne In Me.Controls
If TypeOf nesne Is MSForms.TextBox Or TypeOf nesne Is MSForms.ComboBox Then
nesne.Value = Empty
End If
Next
End Sub