View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ozgrid.com ozgrid.com is offline
external usenet poster
 
Posts: 464
Default Random selection

Try;

Sub Rand3Cards()
Dim lRow As Long, lLoop As Long

For lLoop = 1 To 3
lRow = Int((52 * Rnd) + 1)
Cells(lRow, "B").Copy _
Cells(Rows.Count, "D").End(xlUp)(2, 1)
Next lLoop

End Sub


--
Regards
Dave Hawley
www.ozgrid.com
"Marco Rod" wrote in message
...
Hi,

I need your help to find a solution for the following issue:
I have a file with a list of cards in column B. I need a macro to select
randomly 5% of the cards and copy it in column D.

Is possible to do this?

Thanks for your attention