Hi,
I have a list of names in column A and placed a button between columns B-D. How do i make it so that when i click the button it will randomly select from column A and list on Cell B5.
Hi,
I have a list of names in column A and placed a button between columns B-D. How do i make it so that when i click the button it will randomly select from column A and list on Cell B5.
assign it a macro:
Sub choose()
Dim row As Integer
'this range in the brackets should be the first and last row of your list on column A
row = WorksheetFunction.RandBetween(2, 10)
ActiveSheet.Range("B5") = Range("A" & row)
End Sub
That works Thank you!!!
Last edited by shineres; 05-26-2021 at 01:55 PM.
change the part in RandBetween, i.e. "RandBetween(first row, last row)"
then keep the rest as it was originally
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks