+ Reply to Thread
Results 1 to 2 of 2

Print Code not working

  1. #1
    Registered User
    Join Date
    05-04-2004
    Posts
    15

    Unhappy Print Code not working

    Hi, Im trying to work this so that when the user selects a check box and enters in the cell next to it the number of copies, that the code will print 3 pages per each worksheet that was selected. For some reason I can't see why the code is not working. All the code does is print out blank sheets, and for example, it prints 9 regular sized sheets for the first section, which should be 1 legal size. Any ideas?

    Private Sub PrintSelAnal_Click()

    Dim area As String
    Dim startrow1 As Integer
    Dim startcol1 As Integer
    Dim endrow1 As Integer
    Dim endcol1 As Integer
    Dim startrow2 As Integer
    Dim startcol2 As Integer
    Dim endrow2 As Integer
    Dim endcol2 As Integer
    Dim startrow3 As Integer
    Dim startcol3 As Integer
    Dim endrow3 As Integer
    Dim endcol3 As Integer

    fstyr = Range("FirstAll")
    lstyr = Range("LastAll")

    If CheckBox12.Value = True Then

    For i = 1 To Cells(18, 9).Value

    Sheets(Cells(18, 6).Value).Select

    ' for q 1 and q 2

    startrow1 = 1
    startcol1 = 20
    endrow1 = 56 + 2 * (lstyr - fstyr)
    endcol1 = 46
    With ActiveSheet.PageSetup
    .Orientation = xlLandscape
    .PaperSize = xlPaperLegal
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Range(Cells(startrow1, startcol1), Cells(endrow1, endcol1)).PrintOut copies:=1, Collate:=True

    ' for q3 and q4
    startrow2 = (endrow1 + 1)
    startcol2 = 20
    endrow2 = startrow2 + 42 + 2 * (lstyr - fstyr)
    endcol2 = 46
    With ActiveSheet.PageSetup
    .Orientation = xlLandscape
    .PaperSize = xlPaperLegal
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Range(Cells(startrow2, startcol2), Cells(endrow2, endcol2)).PrintOut copies:=1, Collate:=True

    ' for rest

    startrow3 = 21
    startcol3 = 48
    endrow3 = 124
    endcol3 = 59
    With ActiveSheet.PageSetup
    .Orientation = xlLandscape
    .PaperSize = xlPaperLegal
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With
    Range(Cells(startrow3, startcol3), Cells(endrow3, endcol3)).PrintOut copies:=1, Collate:=True

    Next i

    End If


    THANK YOU SO MUCH!
    Last edited by Sheeny; 05-09-2006 at 10:25 AM.

  2. #2
    Registered User
    Join Date
    05-04-2004
    Posts
    15
    Please Help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1