Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Aug 20, 2001
Messages
2,998
Location
DK
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
 
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

Back
Top