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

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

قام بنشر

للأسف لا يوجد معادلة للقيام بهذا الأمر إلا في الإصدارات الحديثة

وربما تكون طويلة ومعقدة

ولكن يمكنك استعمال هذا الاجراء

Sub RepeatValuesInColumn()
    Dim ws As Worksheet
    Dim sourceRow As Long
    Dim targetRow As Long
    Dim repeatCount As Long
    Dim lastRow As Long
    
    ' تحديد ورقة العمل
    Set ws = ActiveSheet
    
    ' الحصول على آخر صف يحتوي على بيانات في العمود G
    lastRow = ws.Cells(ws.Rows.Count, "G").End(xlUp).Row
    
    ' تحديد صف البدء للعمود J
    targetRow = 7 ' ابدأ من الصف J7
    
    ' التكرار لكل صف في العمود G وH
    For sourceRow = 7 To lastRow
        If ws.Cells(sourceRow, "G").Value <> "" And IsNumeric(ws.Cells(sourceRow, "H").Value) Then
            repeatCount = ws.Cells(sourceRow, "H").Value
            If repeatCount > 0 Then
                Dim i As Long
                For i = 1 To repeatCount
                    ws.Cells(targetRow, "J").Value = ws.Cells(sourceRow, "G").Value
                    targetRow = targetRow + 1
                Next i
            End If
        End If
    Next sourceRow
    
    MsgBox "تم التكرار بنجاح!", vbInformation
End Sub

بالتوفيق

  • Like 3

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