|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Try this:
- Sub zz()
- Dim d, ar, k, Pattern, MyColor
- Set d = CreateObject("scripting.dictionary")
- ar = [j3].CurrentRegion: Pattern = Array("c", "d", "h", "s"): MyColor = Array(43, 37, 48, 56)
- Do
- d(Application.RandBetween(1, 52)) = ""
- Loop Until d.Count = 5
- k = d.keys
- For i = 0 To UBound(k)
- Cells(7, 3 + i) = Application.VLookup(k(i), ar, 2)
- For j = 0 To 3
- With Cells(7, 3 + i)
- If Right(.Value, 1) = Pattern(j) Then .Interior.ColorIndex = Val(MyColor(j)): Exit For
- End With
- Next
- Next
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|