- Tham gia
- 8/6/06
- Bài viết
- 14,535
- Được thích
- 22,810
- Nghề nghiệp
- U80
Mình chỉ biết nhờ bộ thu macro làm giúp thôi; chứ công thức trong VBA để làm khung viền thì mình chịu:Em xin hỏi 1 vấn đề liên quan đến công thức trong VBA ...
=> Làm sao để vẽ khung, viền cho bảng này.
PHP:
Option Explicit
Sub DinhDangVung()
' Macro recorded 4/20/2008 by SaDQ (GPE.COM)'
Range("B2:D20").Select
1 Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlDouble: .Weight = xlThick
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble: .Weight = xlThick
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble: .Weight = xlThick
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble: .Weight = xlThick
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous: .Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous: .Weight = xlThin
End With
2 Range("B3:d3").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
3 With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
End With
4 Rows("2:2").RowHeight = 25
End Sub