R
Rich
Hello,
Last week I had a problem cycling through the PageBreak
Collection in VBA. Tom Ogilvy was kind enough to share an
example how to do this. Worked Great! but a little over
my head since I have never used the Evaluate and Index
functions of Excel in VBA. I have not been able to find
documentation in the help files (or elsewhere) on the code
that was used to set up the Name objects:
ThisWorkbook.Names.Add Name:="hzPB", _
RefersToR1C1:="=GET.DOCUMENT(64,""Sheet1"")"
ThisWorkbook.Names.Add Name:="vPB", _
RefersToR1C1:="=GET.DOCUMENT(65,""Sheet1"")"
I experimented with the name objects using
Names("hzPB").RefersTo:="=Sheet1$A$1:$B$20
instead of RefersToR1C1, but that did not return something
that could be evaluated. Then I tried
RefersToR1C1...'Sheet1'... which gave me a runtime error.
It was this line -- "=GET.DOCUMENT(64,""Sheet1"")" --
which really stumped me. I could not find any
documentation on Get.Document(64,""...""). I would be
grateful if someone could explain to me about Get.Document
(in Excel in this example) or point me to an article or
some source. It seems like this line is the only way to
capture just rows with Pagebreaks.
Thanks in advance,
Rich
Last week I had a problem cycling through the PageBreak
Collection in VBA. Tom Ogilvy was kind enough to share an
example how to do this. Worked Great! but a little over
my head since I have never used the Evaluate and Index
functions of Excel in VBA. I have not been able to find
documentation in the help files (or elsewhere) on the code
that was used to set up the Name objects:
ThisWorkbook.Names.Add Name:="hzPB", _
RefersToR1C1:="=GET.DOCUMENT(64,""Sheet1"")"
ThisWorkbook.Names.Add Name:="vPB", _
RefersToR1C1:="=GET.DOCUMENT(65,""Sheet1"")"
I experimented with the name objects using
Names("hzPB").RefersTo:="=Sheet1$A$1:$B$20
instead of RefersToR1C1, but that did not return something
that could be evaluated. Then I tried
RefersToR1C1...'Sheet1'... which gave me a runtime error.
It was this line -- "=GET.DOCUMENT(64,""Sheet1"")" --
which really stumped me. I could not find any
documentation on Get.Document(64,""...""). I would be
grateful if someone could explain to me about Get.Document
(in Excel in this example) or point me to an article or
some source. It seems like this line is the only way to
capture just rows with Pagebreaks.
Thanks in advance,
Rich