所以代碼如下:
r=("A" & h &" : H" & h)
range(r).Borders(xlEdgeBottom).LineStyle = xlContinuous
xlContinuous是EXCEL邊框線的壹種
還有其它的,可以自己錄制宏去看看
上面是修改過的代碼
下面的是錄制的代碼
Sub Macro2()
'
' Macro2 Macro
' 宏由 YlmF 錄制,時間: 2009-11-24
'
'
Range("A3:H3").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
End Sub