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

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

قام بنشر

الرجاء استفسار ......... هل يمكن دمج مجموعة خلايا ذاتياً باستخدام دالة معينة في حالة احتوائها على نفس البيانات أو إنه يجب استخدام فيجوال بيسك؟

مرفق ملف توضيح

وشكراً

مسألة3.xlsx

قام بنشر

جرب هذا الملف

الماكرو

Option Explicit

Sub MergeSameCell()

Dim Rng As Range
Dim cel As Range
Dim xRows As Integer
Dim i%, j%
Set cel = Range("g3:g6")

Application.ScreenUpdating = False
Application.DisplayAlerts = False

xRows = cel.Rows.Count
For Each Rng In cel.Columns
    For i = 1 To xRows - 1
        For j = i + 1 To xRows
            If Rng.Cells(i, 1).Value <> Rng.Cells(j, 1).Value Then
                Exit For
            End If
        Next
       cel.Parent.Range(Rng.Cells(i, 1), Rng.Cells(j - 1, 1)).Merge
        i = j - 1
    Next
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

 

 

مسألة3 salim.xlsm

قام بنشر

تسلم أستاذ سليم

بارك الله فيك 

حقيقة اتفادى استخدام الماكرو لان حجم البيانات التي أتعامل معها كبير وهذا يؤدي الى بطء في اداء ملفات اكسيل

شكرا

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