+ Reply to Thread
Results 1 to 2 of 2

Print preview multiple sheets macro, based on cell value

  1. #1
    Registered User
    Join Date
    12-03-2019
    Location
    Poland
    MS-Off Ver
    2013
    Posts
    21

    Print preview multiple sheets macro, based on cell value

    Hello dear Users,

    Would anybody help me on the following issue;

    I want a macro that based on the values in the cells , will print preview the particular sheets.
    For example.
    I have a GENERAL sheet and in row no.1 are written the names of the sheets:
    C1 name is sheet1
    D1 is ....empty....
    E1 name is sheet3
    etc....

    I'm using a simple formula:
    ThisWorkbook.Sheets(Array(range("C1").Value, range("D1").Value, range("E1").Value)).PrintPreview

    Everything works fine..but the problem starts when the cell is empty "D1" in that case.

    Is there any way that above formula will ignore the "blanks" and move to the next one (so it will go from C1 to E1 , when D1 is empty).

    Many thanks for help

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Print preview multiple sheets macro, based on cell value

    You can place the following line before your code:

    Please Login or Register  to view this content.
    and before the end :

    Please Login or Register  to view this content.

+ 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] Don't Show Source Sheets For Print Preview and Print Codes
    By fredfarmer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2019, 06:41 AM
  2. [SOLVED] Macro to open Print Preview & Print from Quick Access Toolbar
    By fastcar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2017, 04:58 PM
  3. Change from last print preview selection to the Print Active Sheets
    By Tiger20 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2015, 09:53 AM
  4. Macro slows down when I print/print preview/page break a sheet
    By Grug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2015, 08:59 PM
  5. VBA Macro shows Print Preview page: How to auto-maximize the Print Preview?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2010, 04:48 PM
  6. [SOLVED] Why does macro speed slow after Excel Print or Print Preview?
    By Larry A in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2005, 07:06 AM

Tags for this Thread

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