Hi
I am trying to put a function into a button.
The function is
Function RandomSelection(aRng As Range)
'Update20131113
Dim index As Integer
Randomize
index = Int(aRng.Count * Rnd + 1)
RandomSelection = aRng.Cells(index).Value
End Function
Then I added an array (spin_range) that cover four cells with values 1, 2, 3, 4.
Then I added =randomselection(spin_range) which randomly generates either 1, 2, 3 or 4.
Now I want to add a button to generate this in a cell so I don't have to click into the formula and refresh.
How do I do this?
Many thanks
Bookmarks