Good day everyone.
I have a task to randomly pick 3 random values from column A and store them in column B in cells B1,B2,B3.
Column A contain string values. Column A has X number of available items.
Sample:
COLUMN A
name_tag1
name_tag2
.
.
.
name_tagX
COLUMN B
randompick1
randompick2
randompick3
I wan to write a VBA for a button which when clicked will populate column B with the 3 random values.
I have a sample which seems to work if i have the range as A1:A300 :
So how do i make sure the values are unique. And how can i automatically determine the range of values in column A
Am
I have a task to randomly pick 3 random values from column A and store them in column B in cells B1,B2,B3.
Column A contain string values. Column A has X number of available items.
Sample:
COLUMN A
name_tag1
name_tag2
.
.
.
name_tagX
COLUMN B
randompick1
randompick2
randompick3
I wan to write a VBA for a button which when clicked will populate column B with the 3 random values.
I have a sample which seems to work if i have the range as A1:A300 :
Code:
Sub RndCh()
Set ws = Sheets(1)
rmv = Int((300-1+1) * Rnd + 1)
sh.Range("B1") = sh.Range("A" & rmv)
End Sub
So how do i make sure the values are unique. And how can i automatically determine the range of values in column A
Am