اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

تعديل علي كود ترحيل الفاتورة من يوزر فورم


Tarekchahine
إذهب إلى أفضل إجابة Solved by lionheart,

الردود الموصى بها

السلام عليكم ورحمه الله استاذتنا الكرام

ارجو المساعده في تعديل علي كود الترحيل من اليوزرفورم عند اختيار نوع الفاتوره ترحل الي شيت المطلوبها ( المبيعات او المشتريات او مرتجع ) 

 

poto.jpg

2.jpg

AAAAA.rar

رابط هذا التعليق
شارك

  • أفضل إجابة
Private Sub CommandButton1_Click()
    Dim ws As Worksheet, lastRow As Long, rRow As Long, last As Integer, LS1 As Integer, LAS2 As Integer
    If Evaluate("ISREF('" & ComboBox6.Value & "'!A1)") Then
        Set ws = ThisWorkbook.Worksheets(ComboBox6.Value)
    Else
        MsgBox "Target Worksheet Not Found", vbExclamation: Exit Sub
    End If
    With ws
        .Activate
        rRow = .Cells(1, 1).CurrentRegion.Rows.Count + 1
        last = .Range("A10000").End(xlUp).Row + 1
        For i = 0 To ListBox1.ListCount - 1
            .Cells(last, "F").Value = Me.ListBox1.List(i, 0)
            .Cells(last, "G").Value = Me.ListBox1.List(i, 1)
            .Cells(last, "H").Value = Me.ListBox1.List(i, 2)
            .Cells(last, "I").Value = Me.ListBox1.List(i, 3)
            last = last + 1
        Next i
        LS1 = .Range("A10000").End(xlUp).Row + 1
        ls2 = .Range("F10000").End(xlUp).Row
        For S = LS1 To ls2
            .Cells(LS1, "A").Value = Me.TextBox1.Value
            .Cells(LS1, "b").Value = Me.ComboBox5.Value
            .Cells(LS1, "C").Value = Me.TextBox2.Value
            .Cells(LS1, "D").Value = Me.ComboBox4.Value
            Sheet2.Cells(LS1, "E").Value = Me.ComboBox5.Value
            LS1 = LS1 + 1
        Next S
    End With
    MsgBox "Data Added Successfully", 64
End Sub

 

  • Like 3
رابط هذا التعليق
شارك

زائر
هذا الموضوع مغلق.
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information