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

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

قام بنشر

جرب هذا الماكرو

 

Option Explicit
Sub salim_rand_table()
If ActiveSheet.Name <> "Sheet1" Then Exit Sub
Dim i%, k%, New_arr()
ReDim New_arr(1 To 10, 1 To 2)

Dim my_rg As Range
Dim myStart%: myStart = 1

Dim myEnd%: myEnd = Application.CountA(Range("a:a")) - 1
Set my_rg = Cells(2, 1).Resize(myEnd)

 With CreateObject("System.Collections.SortedList")
    For i = myStart To myEnd
       .Item(Rnd) = i
     Next i
   For k = 1 To 10
      New_arr(k, 1) = my_rg.Cells(.GetByIndex(k))
      New_arr(k, 2) = my_rg.Cells(.GetByIndex(k)).Offset(, 1)
   Next
 End With
  Range("f2").Resize(UBound(New_arr, 1), UBound(New_arr, 2)).Value = New_arr
  Erase New_arr: Set my_rg = Nothing
End Sub

 الملف مع الكود اللازم

Random word Salim.xls

  • 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