随机值组合在excel中

时间:2016-09-10 13:08:02

标签: excel excel-vba vba

我在单元格a中有一个包含大量数据的工作表,在单元格c中的单元格b中只有5行。我想随机地将这5个值与单元格B的数据结合起来。例如:

Cell A |  Cell B  |  Cell C  | Cell D 
======================================
data 1 |  this is | my photo  |this is our photo
data 2 | this is  |your photo |this is my photo     
data 3 | this is  | our photo |this is your photo
data 4 | this is  |           | this is my photo
data 5 | this is  |           | this is our photo

希望你理解我的问题。谢谢

1 个答案:

答案 0 :(得分:5)

D1 中输入:

=B1 & INDEX($C$1:$C$3,RANDBETWEEN(1,3))

并复制下来。例如:

enter image description here