inas aly قام بنشر فبراير 14, 2017 قام بنشر فبراير 14, 2017 درس عباره عن تصفيه بالكود وبشروط – الصوره توضح السلام عليكم اخوانى واخواتى الكرام حبيت اشاركم درس خفيف لقيته بالصدفه منقول للامانه رابط 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 Public Type product name As String pages As String End Type Sub GroupProducts() Dim products() As product Dim lastRow, i, j, n As Long ReDim products(1 To 1) lastRow = Range(“a1”).End(xlDown).Row For i = 2 To lastRow found = False For j = LBound(products) To UBound(products) If Cells(i, 1).Value = products(j).name Then found = True products(j).pages = products(j).pages & “, “ & Cells(i, 2).Value End If Next j If found = False Then n = n + 1 ReDim Preserve products(1 To n) products(n).name = Cells(i, 1).Value products(n).pages = Cells(i, 2).Value End If Cells(i, 1).Value = “” Cells(i, 2).Value = “” Next i For i = LBound(products) To UBound(products) Cells(i + 1, 1).Value = products(i).name Cells(i + 1, 2).Value = products(i).pages Next i End Sub منقول
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.