Merhaba,
Aşağıdaki koda göre a8 den sonra alt alta kayıt yapması için kodu düzenleyemedim. yardımlarınız ricamla
Private Sub CommandButton1_Click()
If ComboBox1 = "" Then
MsgBox "Onaylanmadı" & vbLf & "İsim Seçmediniz.", vbCritical, " UYARI"
ComboBox1.SetFocus
Exit Sub
End If
If WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("E2:E65536"), ListBox1.List(ListBox1.ListIndex, 0)) And WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("F2:F65536"), ListBox1.List(ListBox1.ListIndex, 2)) And WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("D2
65536"), ListBox1.List(ListBox1.ListIndex, 3)) > 0 Then
MsgBox "DAHA ÖNCE BU KAYIT YAPILMIŞ.", vbCritical, "UYARI"
ComboBox1 = Empty
ComboBox1.SetFocus
Exit Sub
End If
If MsgBox(ComboBox1 & " Adına" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 4) & " Tutarındaki" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 3) & " Adet" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 2) & " Ürünü" & vbLf & "Kayıt Yapılsın mı ?", vbQuestion + vbYesNo, " BİLGİ") = vbYes Then
Dim Kuman As Long
Kuman = ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(65536, "a").End(xlUp).Row + 1
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(a + 8, 1) = ListBox1.List(ListBox1.ListIndex, 2)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(b + 8, 2) = ListBox1.List(ListBox1.ListIndex, 1)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(c + 8, 3) = ListBox1.List(ListBox1.ListIndex, 0)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(d + 8, 4) = ListBox1.List(ListBox1.ListIndex, 3)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(e + 8, 5) = CDbl(ListBox1.List(ListBox1.ListIndex, 4))
ComboBox1 = Empty
Else
ComboBox1 = Empty
End If
End Sub
Aşağıdaki koda göre a8 den sonra alt alta kayıt yapması için kodu düzenleyemedim. yardımlarınız ricamla
Private Sub CommandButton1_Click()
If ComboBox1 = "" Then
MsgBox "Onaylanmadı" & vbLf & "İsim Seçmediniz.", vbCritical, " UYARI"
ComboBox1.SetFocus
Exit Sub
End If
If WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("E2:E65536"), ListBox1.List(ListBox1.ListIndex, 0)) And WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("F2:F65536"), ListBox1.List(ListBox1.ListIndex, 2)) And WorksheetFunction.CountIf(ActiveWorkbook.Sheets("SİTE MLZ.LİST").Range("D2
MsgBox "DAHA ÖNCE BU KAYIT YAPILMIŞ.", vbCritical, "UYARI"
ComboBox1 = Empty
ComboBox1.SetFocus
Exit Sub
End If
If MsgBox(ComboBox1 & " Adına" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 4) & " Tutarındaki" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 3) & " Adet" & vbLf & "" & ListBox1.List(ListBox1.ListIndex, 2) & " Ürünü" & vbLf & "Kayıt Yapılsın mı ?", vbQuestion + vbYesNo, " BİLGİ") = vbYes Then
Dim Kuman As Long
Kuman = ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(65536, "a").End(xlUp).Row + 1
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(a + 8, 1) = ListBox1.List(ListBox1.ListIndex, 2)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(b + 8, 2) = ListBox1.List(ListBox1.ListIndex, 1)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(c + 8, 3) = ListBox1.List(ListBox1.ListIndex, 0)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(d + 8, 4) = ListBox1.List(ListBox1.ListIndex, 3)
ActiveWorkbook.Sheets("SİTE MLZ.LİST").Cells(e + 8, 5) = CDbl(ListBox1.List(ListBox1.ListIndex, 4))
ComboBox1 = Empty
Else
ComboBox1 = Empty
End If
End Sub