|
发表于 2017-8-8 15:31
|
显示全部楼层
本楼为最佳答案
- Sub aaa()
- If Selection.Count > 1 Then Exit Sub
- If Intersect([m17].CurrentRegion, Selection) Is Nothing Then Exit Sub
- Dim i&, j&, arr(1 To 3, 1 To 3), n&
- n = IIf(Selection = 0, 9, Selection - 1)
- For i = 1 To 3
- For j = 1 To 3
- arr(i, j) = n + i - 1
- If arr(i, j) > 9 Then arr(i, j) = arr(i, j) Mod 10
- Next j
- Next i
- Cells(26, Selection.Column - 1).Resize(3, 3) = arr
- End Sub
复制代码 |
|