Excel Conditional Content/Formatting for Print vs. Screen and Page Breaks -
I have a VBA publication macro in Excel which creates a published workbook based on the master configuration worksheet and many worksheets. The published version is directly data, still formatted, but with no formulas and fixed notes and background information has not been suppressed Basically, a list of worksheet names and categories is published in master configuration.
To make the published version printable, some worksheets need to insert page breaks. I know that I can include them on the basis of the same configuration, and I can put them in my master sheet Adding more columns can also change the print orientation and margins of a specific worksheet.
Hard bits here If some of these page cats are inserted during a publication process in a table, I would like an informative line to insert before the page break, which indicates that the table continues on the next page. But I only want to show it in the printed version, not displayed in on-screen display.
Is there any way to do this?
First of all, insert a line and hide it before breaking the page. After that, you can use the event on the workbook to find all the rows with "View Next Page" text in it and then bring them to the front.
Set the dim rngCell limit as sub-workbook_BeforePrint (Canceled as Boolean) rngCell = ActiveSheet.UsedRange.Find (see "Next Page"), while not RngCell is nothing If there is nothing rngCell, then rngCell.EntireRow.Hidden = false end if rngCell = ActiveSheet.UsedRange.FindNext () loop End Sub is set
This will give you some extent to you, However, it is not susceptible to the fact that you will be required to leave Note AfterPrint
Sub Workbook_BeforePrint (Canceled as Boolean) Application.EnableEvents = false 'Unlinking Lines here If Workbook.PrintPreview () and Workbook.PrintOut (): So, what you can do The following is the following: 'Rehide rows here Application.EnableEvents = True End Sub
End Cancellation
You will essentially tell if its a print preview Or a real print order. Its very kind, I guess.
Comments
Post a Comment