Results 1 to 4 of 4

Macro that will print each column starting with column B on a seperate page

Threaded View

  1. #1
    Registered User
    Join Date
    09-17-2013
    Location
    WY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Macro that will print each column starting with column B on a seperate page

    I posted this in the general forum before seeing that this forum exists.

    I have a spreadsheet that contains a header column in column A. I need a macro that will print each column starting with column B on a seperate page until it reaches a column with no data and then stop.

    I have compiled the script below from doing various searches, but it is not stoping when there ceases to be column data. Can someone help in tweaking this to work?

    Thanks so much!

    Sub APPPRINT()
    '
    ' APPPRINT Macro
    '
    Dim rng As Range
    For Each rng In Range(Range("A:ZZ"), Cells(Columns.Count, "A").End(xlUp))
    With rng.Parent
    .PageSetup.PrintArea = rng.EntireColumn.Address
    '.PrintOut 'remove the apostrophy
    .PrintPreview 'Add an appostrophy
    End With
    Next rng
    Dim awf As WorksheetFunction: Set awf = WorksheetFunction
    Dim lLR As Long: lLR = Range("A" & Rows.Count).End(xlUp).Row
    Dim CheckRows As Long
    CheckRows = awf.Subtotal(103, Range("A2:A" & lLR))
    If CheckRows = 0 Then
    MsgBox "No rows selected", , "Print Check"
    Exit Sub
    End If
    MsgBox "Printing", , "Print Check"
    End Sub
    Last edited by awebzz; 09-18-2013 at 10:21 AM. Reason: As per Forum Rule #3, please use code tags…Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide Column & Print page Macro printing blank page?!
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2013, 03:59 PM
  2. Macro to print each name in a pivot table filter drop-down on a seperate page
    By Tamarissa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2012, 02:28 PM
  3. Macro to print each tab in a file on a seperate page
    By Tamarissa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2012, 11:11 AM
  4. Macro to print each row on a seperate page with cell line breaks.
    By sjknight in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2012, 04:22 PM
  5. how to print each row on seperate page
    By jvoortman in forum Excel General
    Replies: 0
    Last Post: 05-11-2005, 01:02 PM

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