AMIRBM قام بنشر يونيو 20, 2024 قام بنشر يونيو 20, 2024 السلام عليكم ورحمة الله وبركاته اخواني الكرام أطلب منكم المساعدة في كود vba لترحيل الطلاب من ورقة الى ورقة 45 تلميذا 45 تلميذا في ورقة واحدة بارك الله فيكم جدول 2024.xlsm
تمت الإجابة محمد هشام. قام بنشر يونيو 21, 2024 تمت الإجابة قام بنشر يونيو 21, 2024 (معدل) وعليكم السلام ورحمة الله تعالى وبركاته تفضل اخي الكريم Option Explicit Sub Découpe_45() Dim WS As Worksheet, WS2 As Worksheet Dim i As Long, j As Long, k As Long, x As Long Dim Cpt As Long, r As Long, headers As Range Set WS = ThisWorkbook.Sheets("ورقة1"): Set WS2 = ThisWorkbook.Sheets("ورقة3") Application.ScreenUpdating = False With WS2.Range("A4:F" & WS2.Rows.Count) .Cells.ClearFormats: .Cells.ClearContents End With j = 5: Cpt = 45: Set headers = WS.[A4:F4] k = WS.Range("A:F").Find("*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row For i = j To k Step Cpt If i = j Then headers.Copy Destination:=WS2.[A4] WS.Range("A" & i & ":F" & i + Cpt - 1).Copy Destination:=WS2.Range("A" & j) Else x = WS2.Range("A:F").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 7 headers.Copy Destination:=WS2.Range("A" & x) WS.Range("A" & i & ":F" & i + Cpt - 1).Copy Destination:=WS2.Range("A" & x + 1) End If Next i For r = 1 To 6 WS2.Cells.EntireRow.AutoFit WS2.Columns(r).ColumnWidth = WS.Columns(r).ColumnWidth Application.ErrorCheckingOptions.NumberAsText = False Next Application.ScreenUpdating = True End Sub جدول 2024.xlsb تم تعديل يونيو 21, 2024 بواسطه محمد هشام. 4
AMIRBM قام بنشر يونيو 21, 2024 الكاتب قام بنشر يونيو 21, 2024 بارك الله فيك أستاذ وجزاك الله خيرا شكرا جزيلا 1
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.