احيانا عندالترحيل تظهر المشكله كما بالصورة ارجو الرد للضرورة
On Error Resume Next
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If Me.ComboBox4.Value = "" Then MsgBox "يجب تحديد نوع الدفع", vbExclamation, "تنبية هام": Exit Sub
If Me.ComboBox2.Value = "" Then MsgBox "يجب ادخال اسم العميل", vbExclamation, "تنبية هام": Exit Sub
If Me.o1.Value = "" Then MsgBox "يجب ادخال بيانات الفاتورة", vbExclamation, "تنبية هام": Exit Sub
Sheets("مبيعات تبوك").Activate
Lrow = Range("a" & Rows.Count).End(xlUp).Row + 1
For v = 0 To ListBox1.ListCount - 1
Cells(Lrow, 1).Value = TextBox16.Value
Cells(Lrow, 2).Value = CDate(TextBox1.Value)
Cells(Lrow, 8).Value = l.Caption
Cells(Lrow, 9).Value = ComboBox3.Value
Cells(Lrow, 10).Value = ComboBox2.Value
Cells(Lrow, 7).Value = ListBox1.List(v, 0)
Cells(Lrow, 4).Value = ListBox1.List(v, 3)
Cells(Lrow, 5).Value = ListBox1.List(v, 2)
Cells(Lrow, 6).Value = ListBox1.List(v, 1)
Cells(Lrow, 3).Value = ListBox1.List(v, 4)
Lrow = Lrow + 1
Next v
If Me.ComboBox4.Value = "نقدي" Then
Sheets("الصندوق").Activate
lrows = Sheets("الصندوق").Cells(Rows.Count, "A").End(xlUp).Row
Cells(lrows + 1, 1) = CDate(Me.TextBox1.Value)
Cells(lrows + 1, 2) = Me.o1.Value
Cells(lrows + 1, 5) = Me.ComboBox2.Value
Cells(lrows + 1, 6) = Me.ComboBox3.Value
Cells(lrows + 1, 7) = Me.l.Caption
MsgBox "حفظ فاتورة بيع نقدي باسم" & ComboBox2, vbInformation, " تم بنجاح "
End If
If Me.ComboBox4.Value = "اجل" Then
Sheets("المدينين").Activate
Lrow = Sheets("المدينين").Range("a" & Rows.Count).End(xlUp).Row + 1
For v = 0 To ListBox1.ListCount - 1
Cells(Lrow, 1).Value = CDate(TextBox1.Value)
Cells(Lrow, 2).Value = ComboBox3.Value
Cells(Lrow, 3).Value = ComboBox2.Value
Cells(Lrow, 8).Value = ListBox1.List(v, 3)
Cells(Lrow, 4).Value = ListBox1.List(v, 0)
Cells(Lrow, 7).Value = ListBox1.List(v, 1)
Cells(Lrow, 6).Value = ListBox1.List(v, 2)
Lrow = Lrow + 1
Next v
MsgBox " حفظ فاتورة بيع اجل في حساب " & ComboBox2, vbInformation, "تم بنجاح"
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Unload Me
UserForm3.Show
End Sub