From: Vahid on 26 Mar 2010 03:52 Hi, I would like to extract the total number of pages of an Excel file in a cell so that it is updated automatically. I need to mention the total number of the printed pages in my document (This document contains XX pages and may not be reproduced other than in full). Can you help me?
From: H�ctor Miguel on 26 Mar 2010 04:52 hi, Vahid ! > I would like to extract the total number of pages of an Excel file in a cell so that it is updated automatically. > I need to mention the total number of the printed pages in my document > (This document contains XX pages and may not be reproduced other than in full). *IF* your printed pages refers only to one worksheet (sheet1 ?) try creating/defining a name using xl4 macro-functions (i.e.) name formula nPages =get.document(50+0*now()) use this name on the cell you need to mention that figure (=npages) hth, hector.
From: מיכאל (מיקי) אבידן on 26 Mar 2010 05:31 If you mean counting the total pages of a WorkSheet (not the entire Workbook) then try a UDF to be typed inside a VBA Module: --------------------------- Function PRT_Pages() With ActiveSheet .DisplayAutomaticPageBreaks = True TotPages = (.HPageBreaks.Count + 1) * (.VPageBreaks.Count + 1) End With PRT_Pages = "This document contains " & TotPages & " pages and may not be reproduced other than in full." End Function ----------------- It can be easily converted to count the entire WB pages and/or to an "Before_Print() Event-Macro Micky "Vahid" wrote: > Hi, > I would like to extract the total number of pages of an Excel file in a cell > so that it is updated automatically. > I need to mention the total number of the printed pages in my document (This > document contains XX pages and may not be reproduced other than in full). > > Can you help me?
From: Vahid on 26 Mar 2010 06:41 Hi guys, Many thanks for your help. It works, you're great...
|
Pages: 1 Prev: Where is the graphics selection pointer in excel 2007? Next: Copying Hyperlinks |