+ Reply to Thread
Results 1 to 10 of 10

Hide Selected Rows

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Hide Selected Rows

    Hi All,
    I would like to add a code in the vba codes below to hide a selected rows in a worksheet Sheet2. Let say Row 32:41, Row 70:80 and Row 90:99.

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Hide Selected Rows

    Please Login or Register  to view this content.
    will hide rows that have cells selected.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Hide Selected Rows

    Hi
    Don't I supposed to indicate what rows I needed to hide. I don't need the entire row to be hidden.
    these are the only row that I want to hide so It does no show in the printview.

    Row 32:41, Row 70:80 and Row 90:99

    Thanks.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Hide Selected Rows

    You specified "selected rows" so I assumed they were selected... and you can't hide partial row...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Hide Selected Rows

    Thank you but so Sorry, I probably did not clarify what I was trying to accomplish here. I apologize.

    What I was trying is that when I print the worksheet Sheet2, I don't want to include those row 32:41, and 70:80, and 90:99 to print.

    This is what I added in the code which works.

    Please Login or Register  to view this content.
    Please see the attachment sample worksheet.
    Attached Files Attached Files

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Hide Selected Rows

    That is the same as my last post I believe, except I didn't know you wanted to hard-code the row numbers, and thought you wanted to be able to select them, however, I'm glad that you have it worked out
    I did unhide the rows in my code after print preview, to put it back to normal... which means if you printed manually after the macro finished, those rows would print. You could always add a .Printout command before unhiding, or leave them hidden by removing the .Hidden = False line.

    If your issue is resolved then please mark the thread as solved.
    Last edited by Arkadi; 07-09-2020 at 01:47 PM.

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Hide Selected Rows

    Hi Arkadi,
    I am sorry I don't really understand. My English is not that good and not good with the VBA as well.

    What I want to do is not to print those row when I printed the worksheet.

    I don't understand this part:
    You could always add a .Printout command before unhiding, or leave them hidden by removing the .Hidden = False line.

    Thanks.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Hide Selected Rows

    Ok... is your problem fixed? Or no?
    Do you want to choose rows to not print during macro? Or always same?

  9. #9
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Hide Selected Rows

    Hi
    Not fixed.
    I want rows to choose not to print.

    Thanks

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Hide Selected Rows

    addition, Not always the same

+ 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 rows based on selected Month
    By toci in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-14-2016, 04:33 PM
  2. Hide Selected Rows that does not contain Values from combobox
    By chubbyjenz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2015, 09:10 AM
  3. [SOLVED] VBA to hide multiple rows when a particular value is selected from the dropdown
    By varmoh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-18-2015, 10:47 AM
  4. hide rows with calculated value of 0 when new department is selected
    By cujimmi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2014, 06:14 AM
  5. [SOLVED] Checkbox macros hide and unhide selected rows
    By jasonexcels in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-21-2012, 04:39 PM
  6. hide the rows that are not selected VBA macro
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2011, 12:18 AM
  7. Need to hide all rows except what is currently selected or is empty
    By hyyfte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2011, 11:54 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