Blogger Tricks Blogger Templates

http://meng-kimtong.blogspot.com/

Natural Natural In Computer Lab In Computer Lab My Address: Street 11,05 Village,Sangkat Kampong Leav,Krong Prey Veng,Prey Veng Province,National road 11, (Prey Veng 14553 ),Cambodia
Headlines
Breaking News
Welcome for your visiting my Blogspot,Please have a good luck all time! ©

Monday, February 22, 2016

How to Random Name List with two person at once in VBA of MS Excel

How to Random Name List with two person at once in VBA of MS Excel

Please follow the each step as below:
1-First you create Name list in one column  and  determine the two cells to show the random name
2- then create a module  VBA code by press Alt+F11  .
Example The A column is theName list in one column  ,and the two cells to show the random name are G2 and G3 .
Please see the following code:

Sub PickSomebody()
    Dim class As Range
    Set class = Range("A2", Range("A2").End(xlDown))
    n = class.Rows.Count
    Range("G2") = class(Int(n + 1) * Rnd + Lowerbound, 1)
    Range("G3") = class(Int(n + 1) * Rnd + Lowerbound, 1)
End Sub




0 comments:

Post a Comment

My facebook Page

Blogger Tips and TricksLatest Tips For BloggersBlogger Tricks

My Photo Profile

Powered by Blogger.

ផ្នែកដែលបានជ្រើសរើស

Blogger news

បញ្ជីតាមផ្នែក Category List

Recent Posts

About