Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Printing ranges error

I have a print routine where an array holds the ranges/pages to
be printed. rng1 is the range/page, and it is loaded into an array
(printvarr) as follows:

For Each ws In ActiveWorkbook.Worksheets()
With ws
'Build an array of the ranges to be printed in this sheet
ReDim Printvarr(1 To 1)
For j = 1 To UBound(Pagevarr) - 1
Set rng1 = .Range(Pagevarr(j), Pagevarr(j + 1) _
.Offset(-1, 0)).Resize(, ColsToPrint)
' rng1.Copy 'used to visually check the correct range was copied
If IsEmpty(Printvarr(1)) Then
Set Printvarr(1) = rng1
Else
ReDim Preserve Printvarr(1 To UBound(Printvarr) + 1)
Set Printvarr(UBound(Printvarr)) = rng1
End If
Next
' At this point rng1 is correctly defined and ColToPrint = 7
If Not IsEmpty(Printvarr(1)) Then
With ActiveSheet.PageSetup
.Zoom = False
.LeftMargin = 0
.RightMargin = 0
.TopMargin = 0
.BottomMargin = 0
.HeaderMargin = 0
.FooterMargin = 0
.CenterHorizontally = True
.CenterVertically = True

If ColsToPrint 7 Then
.Orientation = xlLandscape
Else
.Orientation = xlPortrait
End If
End With
For i = 1 To UBound(Printvarr)
' with £Col = 6
If Not (IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) Or _
IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) _
Or Pagevarr(i + 1).Offset(-1, £Col).Value _
= "0.00") Then
'for testing ... toggle as required
Printvarr(i).PrintPreview
'Printvarr(i).PrintOut
End If
Next
End If
End With
Next

rng1 shows columns A to G being in the range, but PrintPreview
only shows A to F. Why is this, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing ranges Tamsyn Excel Discussion (Misc queries) 1 November 24th 08 03:07 PM
Printing ranges Alex Excel Discussion (Misc queries) 7 June 29th 07 01:24 PM
printing Union of Ranges anny Excel Worksheet Functions 2 January 26th 06 10:22 AM
Printing ranges not remembered Shelagh Excel Discussion (Misc queries) 0 January 20th 06 09:42 AM
Printing Ranges Bob[_44_] Excel Programming 1 December 30th 03 06:07 AM


All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"