ä¸ãç»å¯¹å¼ç¨çå®ï¼ç»B3:H10å è¾¹æ¡ï¼
Sub è¾¹æ¡()
'ç»å¯¹å¼ç¨
Range("B3:H10").Select
'å¤è¾¹æ¡çº¿
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'å®çº¿
.Weight = xlThin 'ç»çº¿å
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
End With
'å
æ¡çº¿
With Selection.Borders(xlInsideVertical)
.LineStyle = xlDot 'è线
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlDot
.Weight = xlThin
End With
End Sub
äºãç¸å¯¹å¼ç¨çå®ï¼å¯¹éä¸çåºåæåå
æ ¼å è¾¹æ¡ä¸åºçº¹ï¼
Sub è¾¹æ¡ä¸åºçº¹()
'对éæ©åºå设置边æ¡ä¸åºè²
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble 'å线åè¾¹æ¡
.Weight = xlThick
.ColorIndex = 37 'æµ
å
°è²è¾¹æ¡
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 37
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 37
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 37
End With
'å¡«å
é¢è²
With Selection.Interior
.ColorIndex = 35 'æµ
绿è²åºè²
'.Pattern = xlSolid
'.PatternColorIndex = xlAutomatic
End With
End Sub
ä¸ãç»ç¬¬äºä¸ªå®ï¼è¾¹æ¡ä¸åºçº¹ï¼è®¾ç½®å¿«æ·é®ä¸ºctrl+z
Sub 设置快æ·é®()
Application.MacroOptions Macro:="è¾¹æ¡ä¸åºçº¹", ShortcutKey:="z"
End Sub
å¦æè¦å¨è¡¨2çC3:H10çåºå使ç¨ç¬¬äºä¸ªå®ï¼è¯·éä¸è¿ä¸ªåºåï¼æctrl+zå³å¯
ä¸å¯ç¨ä¸é¢çå®ï¼
Sub abc()
Sheets("表2").Select
Range("C3:H10").Select
Call è¾¹æ¡ä¸åºçº¹
End Sub
温馨提示:答案为网友推荐,仅供参考