As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I realize that this discussion is somewhat beyond the realm of the Focal Point forum but since so many people do templates for EXL2K output:
Does anybody have VBA macro code that will
1. Automatically designate a print area 2. Print only populated cells 3. Return 0” margins on all sides 4. Fix the rows at the top of the page so that these rows will always appear
I’ve been researching online using Messrs. Bing and Google but felt that the Focus Nation might be a good place to search
All the best and thanks in advance for your sage advice, Sandy This message has been edited. Last edited by: S.J. Kadish,
i have not personally done this and have not tested the below to work. However I would do the following:
Place code below (or a call to the code below) in the Workbook.open event.
-Set Print Area
Sub Set_Print_Area()
Dim x As Long, lastCell As Range
x = ActiveSheet.UsedRange.Columns.Count
Set lastCell = Cells.SpecialCells(xlCellTypeLastCell)
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), lastCell).Address
End Sub
(comment: if you're automatically printing the spreadsheet isn't a freeze pane a moot point? It will have no effect on the printed page). Perhaps you want a header instead? (will print across all pages). If so, see here: http://www.cpearson.com/excel/headfoot.htm
** My assumption is that you have some experience with VBA and/or MS Office automation with VBA. If not, this would be a good place to start: http://www.functionx.com/vbaexcel/Lesson01.htm
** I hope this helps. I'm sorry I don't myself have the time to write and test the code you request, but hopefully this will allow you to get started with some examples.
Sub SetPrintArea() Dim PrintA As Range Dim c As Long 'find the last used column in the range (Columns.Count) 'by working from the extreme right, the true last column is found, 'avoiding possible empty cells within that row c = ActiveSheet.Cells(21, Columns.Count).End(xlToLeft).Column 'this will start at A21 Set PrintA = ActiveSheet.Range(Cells(21, 1), Cells(Rows.Count, c).End(xlUp)) ' PrintA.PrintPreview End Sub