乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 求助<em>excel</em>怎样利用<em>vba</em>添加行、

求助<em>excel</em>怎样利用<em>vba</em>添加行、

作者:乔山办公网日期:

返回目录:excel表格制作


比如你要给A1:B11单元格加边框,可以使用以下代码Range("A1:B11").Borders.LineStyle=1
取消边框线 Range("A1:B11").Borders.LineStyle=0

Sub 边框()
Range("a1").BorderAround ColorIndex:=3, Weight:=xlThin '红色、细线
End Sub
下面是vba的代码,要不你参考一下?636f7079e79fa5e98193335
Sub Macro2()
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub

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 '红色、细线zd
Next
Next
End With
QQ:
End Sub

相关阅读

关键词不能为空
极力推荐
  • 会计常用的几个EXCEL操作技巧-excel使用

  • excel使用,EXCEL是财务人员经常使用的软件,今天就给大家介绍几个实用的小方法:。利用单元格格式中的特殊分类,可以灵活地将阿拉伯数字转化为中文大写或者中文小写数字。

ppt怎么做_excel表格制作_office365_word文档_365办公网