+ Reply to Thread
Results 1 to 2 of 2

Macro button to print one color copy and one gray scale.

  1. #1
    Registered User
    Join Date
    08-24-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Macro button to print one color copy and one gray scale.

    Currently have Macro button to print 2 color copies of the finished spreadsheet. Would like it to be one color and one gray scale using the same button.

    Here's what I have so far that working for two color copies:


    Sub PrintForm()
    Dim PrintOption As VbMsgBoxResult
    PrintOption = MsgBox(" Omit Prices?", vbYesNo, "Print Options")
    Const strPassword As String = "Password"
    ActiveSheet.Unprotect Password:=strPassword

    If PrintOption = 6 Then Union(Range("K14:M33,O14:O33"), Range("O34")).Font.Color = vbWhite

    With ActiveSheet.PageSetup
    .PrintArea = "$A$1:$Q$38"
    .LeftMargin = Application.InchesToPoints(0.21)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.21)
    .BottomMargin = Application.InchesToPoints(0.31)
    .HeaderMargin = Application.InchesToPoints(0)
    .FooterMargin = Application.InchesToPoints(0)
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = True
    .Orientation = xlLandscape
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    End With
    ActiveWindow.SelectedSheets.PrintOut Copies:=2
    Union(Range("K14:O33"), Range("O34")).Font.Color = vbBlack
    ActiveSheet.Protect Password:=strPassword

    End Sub

  2. #2
    Registered User
    Join Date
    08-24-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Macro button to print one color copy and one gray scale.

    Since nobody answered my Thread, and about 40 of you seemed interested. After playing around with it some, here's my solution that seems to work for me at the moment. Perhaps it may help you!

    Sub PrintForm()
    Dim PrintOption As VbMsgBoxResult
    PrintOption = MsgBox(" Omit Prices?", vbYesNo, "Print Options")
    Const strPassword As String = "Password"
    ActiveSheet.Unprotect Password:=strPassword

    If PrintOption = 6 Then Union(Range("K14:M33,O14:O33"), Range("O34")).Font.Color = vbWhite

    With ActiveSheet.PageSetup
    .PrintArea = "$A$1:$Q$38"
    .LeftMargin = Application.InchesToPoints(0.21)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.21)
    .BottomMargin = Application.InchesToPoints(0.31)
    .HeaderMargin = Application.InchesToPoints(0)
    .FooterMargin = Application.InchesToPoints(0)
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = True
    .Orientation = xlLandscape
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    End With
    ActiveWindow.SelectedSheets.PrintOut Copies:=1

    If PrintOption = 6 Then Union(Range("K14:M33,O14:O33"), Range("O34")).Font.Color = vbWhite

    With ActiveSheet.PageSetup
    .PrintArea = "$A$1:$Q$38"
    .LeftMargin = Application.InchesToPoints(0.21)
    .RightMargin = Application.InchesToPoints(0.17)
    .TopMargin = Application.InchesToPoints(0.21)
    .BottomMargin = Application.InchesToPoints(0.31)
    .HeaderMargin = Application.InchesToPoints(0)
    .FooterMargin = Application.InchesToPoints(0)
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = True
    .Orientation = xlLandscape
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = True
    End With
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    Union(Range("K14:O33"), Range("O34")).Font.Color = vbBlack
    ActiveSheet.Protect Password:=strPassword
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro Publishes Print Area to MHT with Gray Background
    By ruezo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2014, 11:39 AM
  2. [SOLVED] VBA Code to Gray Out Command Button on Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2013, 02:49 PM
  3. [SOLVED] find a selection bounded by the color gray
    By Janis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-13-2006, 05:35 PM
  4. How do I place an average bar gray-scale in the background?
    By Red_Ink in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-22-2005, 10:05 PM
  5. Link Chart Axis Scale Parameters to Values in Cells via Macro or Button
    By Ronald de Vries in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-22-2005, 08:10 AM

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