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

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

قام بنشر (معدل)

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

12 ساعات مضت, رندة ابراهيم said:

وهناك طلاب يلتحقو فيما بعد

عند النحاق طلبة جدد اضغطي على زر نجميع البيانات  فيتم تحديث البيانات

الكود

Sub CombineSheets()
    Dim ws As Worksheet
    Dim mainSheet As Worksheet
    Dim dataRange As Range
    Dim cell As Range
    Dim lastRow As Long
    Dim newRow As Long
    Dim i As Long
    Dim rowsArray() As Variant

    Set mainSheet = ThisWorkbook.Worksheets(1)
    
    mainSheet.Range("A3:FQ" & mainSheet.Cells(mainSheet.Rows.Count, "A").End(xlUp).Row).ClearContents
    
    newRow = 3
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual

    For Each ws In ThisWorkbook.Worksheets
        If ws.Index <> 1 Then
            Set dataRange = ws.Range("A3:FQ" & ws.Cells(ws.Rows.Count, "A").End(xlUp).Row)
            rowsArray = dataRange.Value
            For i = 1 To UBound(rowsArray, 1)
                lastRow = mainSheet.Cells(mainSheet.Rows.Count, "A").End(xlUp).Row + 1
                mainSheet.Cells(lastRow, 1).Resize(1, UBound(rowsArray, 2)).Value = Application.WorksheetFunction.Index(rowsArray, i, 0)
            Next i
        End If
    Next ws

    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
End Sub

 

تم تعديل بواسطه عبدالله بشير عبدالله
  • Like 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