Search results
Results from the WOW.Com Content Network
ActiveCell = "Page " & xNumPage & " of " & Application.ExecuteExcel4Macro ("GET.DOCUMENT (50)") End Sub. Close the editor and return to the sheet. Select a cell where you want to insert page number. Click Developer>Macros>select that macro>Run. You will see the page number is inserted to that cell. Best regards, Tim.
What may work for you as a formula is: Set up your page size from Page Layout - Size and also set Print Area. Then, count the number of lines on a page (denoted by dotted are) Then enter this formula into a cell (I have used 51 as the number of rows on a page, you will need to change that . . =CONCATENATE ("Page ",INT (ROW ()/51)+1)
Click on the "Insert" tab in the ribbon. 2. Click on the "Header & Footer" button. 3. Select the header or footer section where you want to add the page number. 4. Click on the location in the header or footer where you want to insert the page number. 5. Type "& [Page]" (without the quotes).
Dim CopiesToPrint As Integer. Dim CopyNumber As Integer. CopiesToPrint = Application.InputBox ("Enter # of copies to print:", "Copies", 0, , , , , 1) If CopiesToPrint = 0 Then. Exit Sub. End If. 'these refer to the sheet/form you are going to print. 'and to the cell you want to put the copy # information into. For CopyNumber = 1 To CopiesToPrint.
Couple of macros. One to do page numbers in J3 in a single sheet. You can change to do all sheets. I'm off to lunch. One to set rows to repeat on all sheets. Sub PrintWithPgNumInTitleRow () Dim NumPages As Long, pg As Long. NumPages = ExecuteExcel4Macro ("Get.document (50)") For pg = 1 To NumPages.
Alt+F11 to open VB editor. Right click 'ThisWorkbook' and insert module and paste the code in. On the worksheet in the cell you want the page number to appear type the formula. =Pagenumber () Public Function PageNumber ( _. Optional ByRef rng As Excel.Range) As Variant.
If the document contains more than one section, you may have to add the page number several times (if headers or footers are unlinked). Double-click the header, which activates the header/footer area, and then use the Next and Previous buttons in the Header & Footer Tools Design tab to move between headers/footers.
JLLatham. Replied on June 9, 2011. Report abuse. Headers/Footers and set up the page number in either the header or footer section. The page numbers will do as you wish when the entire workbook is printed. If you only select one or two or a few pages of it, that group will be numbered beginning with 1 and then sequentially for the group selected.
Suppose I have 20 sheets in file and I want print with page number displayed in footer. 1st sheet contains 10 pages, 2nd sheet 5 pages, 3rd sheet 7 pages. If I take printout, after finishing first 10 pages of 1st sheet, 2nd sheet should start from page 11 and 3rd sheet should start from page 16. What should be VBA code. regards
Report abuse. 1. Set page layout>Rows to repeat at top: >Select your headers. 2. Change you margins for the Top and bottom: You should adjust it to let only your header and the first row in the first page. 3. Result: You may share a test workbook and we can set the printer option and send back to you.