Thursday, 15 March 2012

Powerpoint Random Name Selection VBA -



Powerpoint Random Name Selection VBA -

i have next vba code in powerpoint 2010 pick name list @ random:

dim hat new collection sub fill_the_hat() dim items() string dim x long items = split("test\names\john\bob\chris\mike\robert\adam", "\") x = 0 ubound(items) hat.add(items(x)) next x end sub sub pick_one() dim x long randomize x = int(rnd * hat.count) + 1 msgbox hat(x) hat.remove (x) end sub

i need adapt output text box rather msgbox doesn't seem obvious thought be?

any help appreciated,

many thanks, josh

you have adress userform , textbox straight alter contents. illustration be:

userform1.textbox1.text = x

this has happen before userform1.show phone call or alternatively have refresh form via userform1.repaint

vba powerpoint-vba

No comments:

Post a Comment