大侠,可以帮忙改下代码吗,帮忙改成用鼠标选择单元格,再执行操作。
Sub手写()DimrngAsRange,zt,dx,dq,sj,r,i,j,kOnErrorResumeNextApplication.ScreenUpdating=F...
Sub 手写()
Dim rng As Range, zt, dx, dq, sj, r, i, j, k
On Error Resume Next
Application.ScreenUpdating = False
Cells.HorizontalAlignment = xlCenter
Cells.Font.Italic = False
zt = Array("1", "2", "3", "4", "5", "6", "7", "8")
dx = Array(12.5, 13, 13.5)
For Each rng In Range("H8:R11,R12,H13:R14")
rng.Font.Italic = True
rng.HorizontalAlignment = dq(Round(Rnd * 1, 0))
For i = 1 To Len(rng)
rng.Characters(i, 1).Font.Name = zt(Round(Rnd * 7, 0))
rng.Characters(i, 1).Font.Size = dx(Round(Rnd * 2, 0))
Next
Next
Application.ScreenUpdating = True
End Sub 展开
Dim rng As Range, zt, dx, dq, sj, r, i, j, k
On Error Resume Next
Application.ScreenUpdating = False
Cells.HorizontalAlignment = xlCenter
Cells.Font.Italic = False
zt = Array("1", "2", "3", "4", "5", "6", "7", "8")
dx = Array(12.5, 13, 13.5)
For Each rng In Range("H8:R11,R12,H13:R14")
rng.Font.Italic = True
rng.HorizontalAlignment = dq(Round(Rnd * 1, 0))
For i = 1 To Len(rng)
rng.Characters(i, 1).Font.Name = zt(Round(Rnd * 7, 0))
rng.Characters(i, 1).Font.Size = dx(Round(Rnd * 2, 0))
Next
Next
Application.ScreenUpdating = True
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询