Bạn thử:Các anh chị giúp em tạo đường kẻ (Border) màu với.
có phải là :
.Mã:.Borders.LineStyle.CorlorIndex = mau Xanh
Sub abc()
With Selection.Borders
.LineStyle = xlContinuous
.ColorIndex = 50
.Weight = xlThin
End With
End Sub
Sub Macro1()
'
' Macro1 Macro
'
'
Range("B3:G22").Select
Range("B22").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = 0
.Weight = xlThin
End With
End Sub
Sub Macro1()
Range("B3:G22").Select
With Selection.Borders(xlEdgeLeft)
.ThemeColor = 5
End With
With Selection.Borders(xlEdgeTop)
.ThemeColor = 5
End With
With Selection.Borders(xlEdgeBottom)
.ThemeColor = 5
End With
With Selection.Borders(xlEdgeRight)
.ThemeColor = 5
End With
With Selection.Borders(xlInsideVertical)
.ThemeColor = 5
End With
With Selection.Borders(xlInsideHorizontal)
.ThemeColor = 5
End With
End Sub
http://www.giaiphapexcel.com/diendan/threads/chia-s%E1%BA%BB-h%E1%BB%8Dc-vba-c%C4%83n-b%E1%BA%A3n-qua-h%C3%ACnh-%E1%BA%A3nh.125824/
Thử code này:Các anh chị giúp em tạo đường kẻ (Border) màu với.
có phải là :
.Mã:.Borders.LineStyle.CorlorIndex = mau Xanh
Sub Macro1()
Range("B3:G22").Borders.Color = vbBlue
End sub
Sub Mau_GRB()
Range("B3:G22").Borders.Color = rgb(0, 0, 255)
End Sub