dangky47h
Thành viên thường trực
- Tham gia
- 4/9/17
- Bài viết
- 341
- Được thích
- 41
- Giới tính
- Nam
Cố bon chen 1 tí rồi đi ngủEm in trang trong excel, đến cuối trang thì viền trang ở chân trang là nét đứt, em muốn khi in đến hết trang thì viền trang là nét liền
Mong sự giúp đỡ của các Anh Chị ạ!
Sub In_Dinhdang()
Dim I As Long, Er As Long
Dim P As Long, R As Long
ActiveWindow.View = xlPageBreakPreview
P = ActiveSheet.HPageBreaks.Count
Er = Range("A" & Rows.Count).End(3).Row
For I = 1 To P
R = ActiveSheet.HPageBreaks(I).Location.Row - 1
If R < Er Then Range("A" & R & ":M" & R). _
Borders(xlEdgeBottom).Weight = xlThin
Next
ActiveSheet.PrintPreview
Range("A4:M" & Er). _
Borders(xlInsideHorizontal).Weight = xlHairline
ActiveWindow.View = xlNormalView
End Sub
Chị ơi!Cố bon chen 1 tí rồi đi ngủ
PHP:Sub In_Dinhdang() Dim I As Long, Er As Long Dim P As Long, R As Long ActiveWindow.View = xlPageBreakPreview P = ActiveSheet.HPageBreaks.Count Er = Range("A" & Rows.Count).End(3).Row For I = 1 To P R = ActiveSheet.HPageBreaks(I).Location.Row - 1 If R < Er Then Range("A" & R & ":M" & R). _ Borders(xlEdgeBottom).LineStyle = xlContinuous Next ActiveSheet.PrintPreview Range("A4:M" & R). _ Borders(xlInsideHorizontal).Weight = xlHairline ActiveWindow.View = xlNormalView End Sub
Hì hì. Nhà em bị nhầm đáng nhẽ nó phải là Borders(xlEdgeBottom).Weight = xlThin cơ
Chuẩn không cần chỉnh rồi chị đẹp ơi!Hì hì. Nhà em bị nhầm đáng nhẽ nó phải là Borders(xlEdgeBottom).Weight = xlThin cơ
Sao là chuẩn, nó vầy chứ:Chuẩn không cần chỉnh rồi chị đẹp ơi!
Chúc chị đẹp ngủ ngon!
Sub DuongKeVieng()
Dim i As Long
ActiveWindow.View = xlPageBreakPreview
For i = 1 To ActiveSheet.HPageBreaks.Count
With ActiveSheet.HPageBreaks(i).Location.Offset(-1).Columns("A:M").Borders(xlEdgeBottom)
.LineStyle = xlContinuous: .Weight = xlThick: .ColorIndex = xlAutomatic
End With
Next
ActiveWindow.View = xlNormalView
End Sub
E cám ơn ạ!Hì hì. Nhà em bị nhầm đáng nhẽ nó phải là Borders(xlEdgeBottom).Weight = xlThin cơ
Tạo cả viền khung à Chị?Hì hì. Nhà em bị nhầm đáng nhẽ nó phải là Borders(xlEdgeBottom).Weight = xlThin cơ
Nếu tạo viềng nữa thì vầy:E cám ơn ạ!
Bài đã được tự động gộp:
Tạo cả viền khung à Chị?
Sub Vieng_Moi()
Dim i As Long
Sheet4.Range("A1").CurrentRegion.Borders.LineStyle = xlContinuous
ActiveWindow.View = xlPageBreakPreview
For i = 1 To ActiveSheet.HPageBreaks.Count
With ActiveSheet.HPageBreaks(i).Location.Offset(-1).Columns("A:M").Borders(xlEdgeBottom)
.LineStyle = xlContinuous: .Weight = xlThick: .ColorIndex = xlAutomatic
End With
Next
ActiveWindow.View = xlNormalView
End Sub
Nếu tạo viềng nữa thì vầy:
Mã:Sub Vieng_Moi() Dim i As Long Sheet4.Range("A1").CurrentRegion.Borders.LineStyle = xlContinuous ActiveWindow.View = xlPageBreakPreview For i = 1 To ActiveSheet.HPageBreaks.Count With ActiveSheet.HPageBreaks(i).Location.Offset(-1).Columns("A:M").Borders(xlEdgeBottom) .LineStyle = xlContinuous: .Weight = xlThick: .ColorIndex = xlAutomatic End With Next ActiveWindow.View = xlNormalView End Sub
Dạ, E cám ơn Thầy đã giúpNếu tạo viềng nữa thì vầy:
Mã:Sub Vieng_Moi() Dim i As Long Sheet4.Range("A1").CurrentRegion.Borders.LineStyle = xlContinuous ActiveWindow.View = xlPageBreakPreview For i = 1 To ActiveSheet.HPageBreaks.Count With ActiveSheet.HPageBreaks(i).Location.Offset(-1).Columns("A:M").Borders(xlEdgeBottom) .LineStyle = xlContinuous: .Weight = xlThick: .ColorIndex = xlAutomatic End With Next ActiveWindow.View = xlNormalView End Sub