Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

No pages in a cell 1

Status
Not open for further replies.

MortenA

Chemical
Aug 20, 2001
2,998
I want to print the total no of printed pages in a cell but cant find a funtion for this in EXCELL.

I therefore wrote a small VB function that looks like this:

Public Function nossheet() As Variant
nossheet = ActiveSheet.HPageBreaks.Count + 1
End Function

I seems to work - but it wont update. If the number of pages grow it stays a the initial value. Not by recalc and not by closing and opening the sheet.

Could anybody tell me what would make this value update?

Best regards

Morten
 
Replies continue below

Recommended for you

Try Application.Volatile statement, just after the Public Function statement.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
great

That seemed to work.

Best regards

Morten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor