+ Reply to Thread
Results 1 to 2 of 2

Print CurrentRegion w/in BeforePrint Event

Hybrid View

  1. #1
    Registered User
    Join Date
    11-19-2006
    Posts
    26

    Print CurrentRegion w/in BeforePrint Event

    I am trying to print the current region of a worksheet within a before print event. Not sure what is wrong with my code. The error message is: unable to get the CurrentRegion property of the Range class.

    Private Sub Workbook_BeforePrint(Cancel As Boolean) 
    With ActiveSheet 
    Range("A5").Select 
    Selection.CurrentRegion.Select 
    Selection.PrintOut Copies:=1, Preview:=True, Collate:=True 
    Range("A5").Select 
    End With 
    End Sub

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Cart0250,

    Here is the working code.

    Private Sub Workbook_BeforePrint(Cancel As Boolean) 
    
        ActiveSheet.Range("A5").CurrentRegion.Select 
        Selection.PrintOut Copies:=1, Preview:=True, Collate:=True 
    
    End Sub
    Sincerely,
    Leith Ross

+ 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