Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-16-2022, 08:44 AM
Marcia's Avatar
Marcia Marcia is offline Bottom Line in every page Windows 10 Bottom Line in every page Office 2019
Expert
Bottom Line in every page
 
Join Date: May 2018
Location: Philippines
Posts: 553
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default Bottom Line in every page

Hi. I found in another site a code that draws a bottom line at every page of a data sheet. I would prefer that the vba need not show a print preview and the bottom line should be drawn from col B to F.
Thank you for all the help, past and present.
Code:
Sub BottomLine()
Dim ws As Worksheet
Dim pb As HPageBreak
Dim LastRow As Long


For Each ws In ThisWorkbook.Worksheets
ActiveWindow.View = xlPageBreakPreview

For Each pb In ws.HPageBreaks
LastRow = pb.Location.Offset(-1, 0).Row

With ws.Rows(LastRow).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
Next pb
Next ws
End Sub

Attached Files
File Type: xlsm Lines.xlsm (45.5 KB, 10 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bottom Line in every page Table styles - First column shading with bottom line on page break NicB Word Tables 2 02-20-2019 03:05 AM
Paginate table so cell headings appear top of page instead bottom page when no room bottom page mtcn Word Tables 5 12-11-2014 12:49 PM
Bottom Line in every page get rid of line above page numbers at bottom of pages. Joanrichmond Word 1 02-11-2014 12:57 PM
Bottom Line in every page line and ?object at bottom of page in word 2007 doc btdaniel Word 10 07-23-2012 03:03 AM
Bottom Line in every page Horizontal line at bottom and top each page BrutalLogiC Word 1 07-03-2011 02:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft