- Katılım
- 12 Eylül 2004
- Mesajlar
- 885
- Excel Vers. ve Dili
- Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
Kod:
Private Sub CommandButton1_Click()
Dim bak As Range
Dim say As Integer
For Each bak In Range("b1:b" & WorksheetFunction.CountA(Range("b1:b65000")))
If bak.Value = ComboBox1.Value Then
MsgBox ""
Exit Sub
End If
Next bak
For Each bak In Range("c2:c" & WorksheetFunction.CountA(Range("c2:c65000")))
If bak.Value = ComboBox2.Value Then
MsgBox "Bu öğrenci bu kitabı daha önce almış."
Exit Sub
End If
Next bak
If Range("A2").Value = "" Then
Range("A2").Select
ActiveCell.Value = 1
ActiveCell.Offset(0, 1) = ComboBox1
ActiveCell.Offset(0, 2) = ComboBox2
ActiveCell.Offset(0, 3) = ComboBox3
ActiveCell.Offset(0, 4) = TextBox1
ActiveCell.Offset(0, 5) = TextBox2
ActiveCell.Offset(0, 6) = TextBox3
Else
[A65536].End(xlUp).Offset(1, 0).Select
ActiveCell = ActiveCell.Offset(-1, 0) + 1
ActiveCell.Offset(0, 1) = ComboBox1
ActiveCell.Offset(0, 2) = ComboBox2
ActiveCell.Offset(0, 3) = ComboBox3
ActiveCell.Offset(0, 4) = TextBox1
ActiveCell.Offset(0, 5) = TextBox2
ActiveCell.Offset(0, 6) = TextBox3
End If
ComboBox1 = ""
ComboBox2 = ""
ComboBox3 = ""
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
End Sub
