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

مساعدة في كود


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

بالنسبة لزيادة الصفوف بمكن ذلك لكن الملف يصبح ثقيل جداً ويأخذ وقتاً لنتفيذ كل المعادلات (10000 معادلة مع كل ضغطة على اي مفتاح من الكيبورد)

لذلك اقترح هذا الماكرو

Option Explicit

Sub extract_data()
If ActiveSheet.Name <> "salim_macro" Then GoTo Leave_Me_Olone
Application.ScreenUpdating = False
    Dim Ro%, Col%, i%, k%, lrA%, LrC%
    Dim Arr
    Ro = 4: Col = 5

lrA = Cells(Rows.Count, 1).End(3).Row
LrC = Cells(Rows.Count, 3).End(3).Row

  With Range("E4").Resize(lrA * LrC, 500)
    .ClearContents
    .Interior.ColorIndex = xlNone
  End With
 
 For i = 4 To lrA
      For k = 4 To LrC
        Arr = Trim(Split(Range("C" & k), "-")(0))
        
        If Trim(Range("A" & i)) = Arr Then
             With Cells(Ro, Col)
              .Value = Range("C" & k)
              .Columns.AutoFit
              .Interior.ColorIndex = 4
             End With
            Col = Col + 1
        End If
      
      Next
     Ro = Ro + 1: Col = 5
  Next
Leave_Me_Olone:
  Application.ScreenUpdating = True
End Sub

الملف مرفق صفحة  "salim_macro"

 

File_Macro.xlsm

  • 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