Hi,

I am trying to count pages to be printed in each sheet, but the HPageBreaks.Count sometimes returns an incorrect results (other times it works perfectly well). My code is below. Does anyone have any ideas why it does not consistently yield the correct answer?

For each sh in ActiveWindow(1).SelectedSheets
debug.print sh.HPageBreaks.Count
Next sh