Excel 怎么用VBA代码给表格加上边框
答案:1 悬赏:50 手机版
解决时间 2021-02-11 18:17
- 提问者网友:十年饮冰
- 2021-02-11 15:03
Excel 怎么用VBA代码给表格加上边框
最佳答案
- 五星知识达人网友:未来江山和你
- 2021-02-11 15:46
Private Sub CommandButton1_Click()
Dim I, L,J, M
Set SH1 = Sheet1
On Error GoTo QQ
M = InputBox("输入行数!")
If M = "" Then Exit Sub
With SH1
L = .[A1000].End(xlUp).Row
For I = 1 To M
.Cells(I + L, 1) = .Cells(L, 1) + I
For J = 1 To 5
.Cells(I + L, J).BorderAround ColorIndex:=3, Weight:=xlThin '红色、细线
Next
Next
End With
QQ:
End Sub
Dim I, L,J, M
Set SH1 = Sheet1
On Error GoTo QQ
M = InputBox("输入行数!")
If M = "" Then Exit Sub
With SH1
L = .[A1000].End(xlUp).Row
For I = 1 To M
.Cells(I + L, 1) = .Cells(L, 1) + I
For J = 1 To 5
.Cells(I + L, J).BorderAround ColorIndex:=3, Weight:=xlThin '红色、细线
Next
Next
End With
QQ:
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯