IOW, is there a way to programmatically obtain the current page number of
the active cell?
ActiveSheet.Printout From:=1, To:=2
you can change activesheet to a sheet you want.
Regards Ron
"Norm" <ida...@conversent.net> schreef in bericht
news:#i2eEuWDCHA.1940@tkmsftngp04...
The point is to come up with something that minimizes keystrokes in order to
print just the current page. I want to come up with something akin to the
'Print Current Page' command that exists in Word.
"Ron de Bruin" <ronde...@kabelfoon.nl> wrote in message
news:Og6Mb3WDCHA.2576@tkmsftngp04...
try this
Laurent Longre posted the following code on April 21 2000, which
displays a message box with the page number. To print the page, I added
a line at the end of the macro:
Sub PrintCurrentPage()
Dim VPC As Integer, HPC As Integer
Dim VPB As VPageBreak, HPB As HPageBreak
Dim NumPage As Integer
If ActiveSheet.PageSetup.Order = xlDownThenOver Then
HPC = ActiveSheet.HPageBreaks.Count + 1
VPC = 1
Else
VPC = ActiveSheet.VPageBreaks.Count + 1
HPC = 1
End If
NumPage = 1
For Each VPB In ActiveSheet.VPageBreaks
If VPB.Location.Column > ActiveCell.Column Then Exit For
NumPage = NumPage + HPC
Next VPB
For Each HPB In ActiveSheet.HPageBreaks
If HPB.Location.Row > ActiveCell.Row Then Exit For
NumPage = NumPage + VPC
Next HPB
'MsgBox "Page number of the active cell = " & NumPage
ActiveWindow.SelectedSheets.PrintOut _
From:=NumPage, To:=NumPage, _
Copies:=1, Collate:=True
End Sub
"Norm" <ida...@conversent.net> schreef in bericht
news:#DncGNYDCHA.2884@tkmsftngp04...
"Ron de Bruin" <ronde...@kabelfoon.nl> wrote in message
news:eKiTSUYDCHA.2212@tkmsftngp02...
<<I added a line at the end of the macro>>
by the way the last line in the macro is from Debra Dalgleish.
Before she got mad at me.(vbg)
Regards Ron
"Norm" <ida...@conversent.net> schreef in bericht
news:#LDLsdYDCHA.1764@tkmsftngp02...
I hope she have a nice time in holland.
Regards Ron
"Debra Dalgleish" <d...@contextures.com> schreef in bericht
news:3CFFAF5A...@contextures.com...
Dim CurrentPage As Long
Dim TotalPages As Long
'// Save Settings...
ActiveWorkbook.CustomViews.Add _
ViewName:="_temp", _
PrintSettings:=True, _
RowColSettings:=True
'// Remove Manual PrintArea
ActiveSheet.PageSetup.PrintArea = False
'// Your code to Print here...
'// When done...
'// Reset PrintArea
TotalPages = ExecuteExcel4Macro("Get.Document(50)")
With ActiveWorkbook.CustomViews("_temp")
.Show
.Delete
End With
MsgBox "Printing Page : " & CurrentPage & " out of " & TotalPages
' etc....
--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =
"Ron de Bruin" <ronde...@kabelfoon.nl> wrote in message
news:eDGfujYDCHA.2172@tkmsftngp04...
His attitude is getting closer to being Canadian.
Maybe in a couple years, he'll be American (yeah, I know, Canada is in
America--United Statesian???
<VBSEG>
Another one to lookup!!!
--
Dave Peterson
ec3...@msn.com
Paul
"Dana DeLouis" <ng_...@hotmail.com> wrote in message
news:eEe8mwaDCHA.2164@tkmsftngp02...
Not in the <FM> Dave
Regards Ron
"Dave Peterson" <ec3...@msn.com> schreef in bericht
news:3CFFFDED...@msn.com...
I knew SEG long ago. It wasn't until fairly recently (last year or so?) I
figured out what VBG meant.
- Jon
______
In article <3CFFFDED...@msn.com>, ec3...@msn.com says...