随机使用天秤座办公室随机selectExcel文件

我有一个由1000×3字组成的excel文件。 我在这里写了5行作为例子。

Target choice1 choice2 choice3 booklet criquet nutmeg luciole argoman border phobie liom mouche libellule taplet luciole abrot guêpe terrier greeca 

不过我现在知道choice2中的所有单词都是正确的答案,我想用下面的天秤座办公室随机的把select1和select2和select3的地方混合起来:

  Target choice1 choice2 choice3 booklet nutmeg criquet luciole argoman phobie liom border mouche taplet libellule luciole abrot terrier guêpe greeca 

我是新来的excel,我不知道如何使用它。 请告诉我如何做到这一点,并提前感谢所有的意见。

这么晚才回复很抱歉。

你可以使用这样的东西:

 Sub MixTheValues() Dim x, y, r Dim Words As New Collection For x = 2 To Cells(Rows.CountLarge, "B").End(xlUp).Row For y = 2 To 4 Words.Add (Cells(x, y).Value) Next y For y = 2 To 4 r = Int(Words.Count * Rnd + 1) Cells(x, y).Value = Words(r) Words.Remove (r) Next y Next x End Sub 

x从第2行开始,到最后一行。

y定义了你想要使用的列(在这种情况下, 2 to 4B to D

请注意,这是洗牌的答案,但因为它是完全随机的,其中一些可能根本不动。

结果:

结果