اذهب الي المحتوي
أوفيسنا

احضار بيانات


إذهب إلى أفضل إجابة Solved by حسين مامون,

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

السلام عليكم ورحمة الله وبركاته

برجاء المساعدة في الشيت المرسل حيث انني ارغب عند كتابه اسم الشركة في الشيت 2 يتم جلب البيانات المطلوبه من الشيت الاساسي ولو كانت اكثر من صف يتم اضافتها جميعا كل صف على حدة ارجو ان يكون الطلب واضح 

وشكرا 

Bank Cheque.xlsx

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

Sub test()
    Dim a As Variant, lr, i, x, s, k, itm
    Dim bch As Worksheet
    Set bch = Sheets("Bank Cheque")
    lr = bch.Cells(Rows.Count, "a").End(xlUp).Row - 1
    a = Application.Index(bch.Cells(2, 2).Resize(lr, 21).Value, Application.Evaluate("row(1:" & lr & ")"), Array(1, 2, 6, 7, 8, 13, 16, 20))
    With CreateObject("scripting.dictionary")
        For i = 1 To UBound(a)
            If bch.Cells(i + 1, 4) = Sheets("Sheet4").Range("d3") And bch.Cells(i, 4) <> "" Then
                If Not .exists(Cells(i + 1, 4)) Then
                    .Add bch.Cells(i + 1, 4), a(i, 1) & Chr(162) & a(i, 2) & Chr(162) & a(i, 3) & Chr(162) & a(i, 4) & Chr(162) & a(i, 5) & Chr(162) & a(i, 6) & Chr(162) & a(i, 7) & Chr(162) & a(i, 8)
                Else
                    .Item(bch.Cells(i + 1, 4)) = .Item(Cells(i + 1, 4)) & Chr(162) & a(i, 1) & Chr(162) & a(i, 2) & Chr(162) & a(i, 3) & Chr(162) & a(i, 4) & Chr(162) & a(i, 5) & Chr(162) & a(i, 6) & Chr(162) & a(i, 7) & Chr(162) & a(i, 8)
                End If
            End If
        Next
        k = .keys
        itm = .items
        Ct = .Count
        With Sheets("Sheet4")
            Range("a8:f10000").ClearContents
            For i = 1 To Ct
                x = Split(itm(i - 1), Chr(162))
                .Range("a" & 8 + i - 1).Resize(, UBound(x) + 1) = x
            Next
        End With
    End With
End Sub

اسم الشركة فيD3

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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

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

Important Information