Results 1 to 4 of 4

Macro to open printer box not working

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-16-2004
    Posts
    125

    Macro to open printer box not working

    The macro below is designed to print several reports. It prints a report for each ID number listed in a specific column. It works fine except when the print box opens the cancel button does not work. If I decide I want to change something and hit cancel it prints anyways. Can anyone help solve how I can get the cancel button to stop printing and just cancel? Please keep in mind I am a beginner with VBA. Thanks for any help.

    Dim endrow As Long
    Application.Dialogs(xlDialogPrinterSetup).Show
        endrow = Cells(Rows.Count, "A").End(xlUp).Row
     For i = 2 To endrow
        If Cells(i, 1).Value <> "" And Cells(i, 1).Value <> " " Then
             Range("L6").Value = Cells(i, 1).Value
             Sheets("Report").PrintOut Copies:=1, Collate:=True
       End If
     Next i
    End Sub
    Last edited by CJ-22; 09-14-2009 at 12:21 PM.

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