+ Reply to Thread
Results 1 to 5 of 5

Problem with Macro printing code

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Problem with Macro printing code

    I have a vba code for a form needing to print out only some specific information. This code is a "before print" code and will change the cell content's font to the background color so the information will not appear. Everything seems to work perfectly except, for some reason, the print screen does not appear when I click print and the form prints directly to my default printer. Since many people will be using/printing this form from different computers, I need this print screen to appear so they may choose which printer to print to. Strangely enough, I am able to get to this print screen when I go to print preview first, but not when I select print directly. I have copied my current code below for editing. Since I was able to find this code online, and I am very bad at vba programming, I was hoping someone could make edits in the code for me. Thanks!

    Please Login or Register  to view this content.
    Last edited by arlu1201; 06-25-2012 at 08:12 AM. Reason: Use code tags in future.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Problem with Macro printing code

    Have you tried this?

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    05-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Problem with Macro printing code

    Would that replace the Sheet2.PrintOut command? Also, I was hoping there would be a way for the print screen to actually appear when anyone selects print (so they don't need to go to print preview first). Thanks for your help!

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Problem with Macro printing code

    In that case use this.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Problem with Macro printing code

    Hmm okay, the print preview command that you posted brings up print preview even when you just want to directly print it. And the dialogs print command brings up the print screen even when you click print preview, which is a bit confusing. Is there any way to bring up the print screen when someone selects print but also allows someone to select print preview without the print screen popping up first?

+ 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