+ Reply to Thread
Results 1 to 5 of 5

Print Macro - Hide/Unhide Columns based on Value

  1. #1
    Registered User
    Join Date
    07-26-2006
    MS-Off Ver
    Office 365
    Posts
    97

    Print Macro - Hide/Unhide Columns based on Value

    Hello,
    I have a print issue that changes on a monthly basis. See attachment for a better understanding.

    The range I am trying to print is B2:BS50.

    I have identified the columns that I would like to have printed by putting a “P” in Row1 (A1:BS1). The columns I don’t want printed (hidden) are marked with a “H” in the same range (A1:BS1).

    I am looking for a print macro that will hide all columns within the range that are marked with an “H”, print the range on 11x17 landscape, and then unhide the columns that were previously hidden.

    Any feedback helps. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Print Macro - Hide/Unhide Columns based on Value

    This macro might work for you...
    Please Login or Register  to view this content.
    If you record a macro of yourself printing the worksheet, you'll see a lot of other 'PageSetup' options you can modify, too.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Print Macro - Hide/Unhide Columns based on Value

    Hello Cardan,

    Please see the attached tutorial sample Workbook, which will allow you to understand your issue and solution much better!

    Happy learning.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    07-26-2006
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Print Macro - Hide/Unhide Columns based on Value

    This works! Thank you!

  5. #5
    Registered User
    Join Date
    07-26-2006
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Print Macro - Hide/Unhide Columns based on Value

    This is very informative. Thank you for the lesson!

+ 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. Macro to Hide/Unhide Columns Based on a Validation List
    By Legalhustler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2015, 01:23 PM
  2. hide and unhide columns based on cell value
    By darijokesar in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-29-2014, 03:51 AM
  3. [SOLVED] Hide/Unhide columns based on the value of the cell help!
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-11-2014, 09:03 PM
  4. [SOLVED] Hide/Unhide Columns based on Cell Value
    By dberg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-26-2013, 03:36 PM
  5. Hide and unhide columns based on value of 0 or 1 (respectively) in cells G1:LG1
    By cplawren in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2012, 01:58 AM
  6. Hide/Unhide columns based on value of a cell
    By redrackham in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2011, 09:14 AM
  7. Hide & Unhide columns based on a cell value
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2010, 09:40 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