Results 1 to 4 of 4

Thread: [Excel] Need to print pages only with text

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2010
    Posts
    1

    [Excel] Need to print pages only with text

    I have a problem that is frustrating me, because I don't think it is as hard as I'm making it out to be.

    I have a spreadsheet with a set print area of 17 pages. However, there won't always be 17 pages worth of information. There may only be, say, 7 pages to print this quarter, or 10 next quarter. Is there a way I can set up a macro to print only the pages with text?

    Also, I need to do this over multiple worksheets.

    Any insight is much appreciated! Thank you!

  2. #2
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: [Excel] Need to print pages only with text

    Is there a reason you have the print area set? I would think you would use this if you DID want to print the whole area. Without knowing how your spreadsheets are set up, its difficult to answer this.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Excel] Need to print pages only with text

    you could try like
    Sheets("sheet1").UsedRange.PrintOut
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: [Excel] Need to print pages only with text

    Instead of using Sheets("sheet1").UsedRange.PrintOut, just remove PrintArea (leave it blank).
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width