能否用B列做辅助列
在B1输入
=IF(A1="","",CHOOSE(RANDBETWEEN(1,3),"A","B","C"))
当A列输入内容时,B列就随机出现A、B、C三个字母
然后在把AB列合并起来
好像很难在原单元格做自动修改啊,尝试写了个Worksheet_Change(ByVal Target As Range),结果因为最后添加了一个字符,于是再次执行,执行后又加一个字符,第三次执行……,等高人
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Target = Target & Mid("ABC", Int(Rnd * 3 + 1), 1)
Application.EnableEvents = True
[A1].Select
End If
End Sub