Nhờ Anh (Chị) giúp đỡ về vấn đề in trong excel (1 người xem)

Liên hệ QC

Người dùng đang xem chủ đề này

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
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ền123456.jpg
Mong sự giúp đỡ của các Anh Chị ạ!
 

File đính kèm

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ị ạ!
Cố bon chen 1 tí rồi đi ngủ :p:p:p
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).Weight = xlThin
Next
ActiveSheet.PrintPreview
Range("A4:M" & Er). _
        Borders(xlInsideHorizontal).Weight = xlHairline
ActiveWindow.View = xlNormalView
End Sub
 
Lần chỉnh sửa cuối:
Upvote 0
Cố bon chen 1 tí rồi đi ngủ :p:p:p
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
Chị ơi!
SAo em dùng code chị lại vẫn ra nét đứt.Capture.PNGCapture.PNG
 
Upvote 0
Upvote 0
Upvote 0
Chuẩn không cần chỉnh rồi chị đẹp ơi!
Chúc chị đẹp ngủ ngon!
Sao là chuẩn, nó vầy chứ:
.Weight = xlThick

Mã:
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
 
Lần chỉnh sửa cuối:
Upvote 0
Upvote 0
E cám ơn ạ!
Bài đã được tự động gộp:


Tạo cả viền khung à Chị?
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
 
Upvote 0
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
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úp
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom