+ Reply to Thread
Results 1 to 3 of 3

VBA hiding non adjacent rows

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    VBA hiding non adjacent rows

    Hi

    I use this code to hide rows in various sheets.

    Easy question, how do I hide rows that are not next to each other?
    ie, Rows 45, 47, 89, 91

    Thanks.

    Sub Hide_Unhide_Rows()
    '
    ' Hide Unhide Rows
    '
    If Rows("45").EntireRow.Hidden = False Then
    Rows("45").EntireRow.Hidden = True
    Else
    Rows("45").EntireRow.Hidden = False
    End If
    End Sub

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: VBA hiding non adjacent rows

    Hello A440,

    Here's a sugestion :
    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: VBA hiding non adjacent rows

    Thanks works for me, it takes a while to do it's thing, but hey :-)

+ 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. Replies: 2
    Last Post: 08-02-2013, 10:41 PM
  2. Questions on hiding DTPicker if the adjacent cell is blank.
    By PLC_Joe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2013, 08:39 AM
  3. Hiding a button when hiding rows
    By fergusor in forum Excel General
    Replies: 2
    Last Post: 08-10-2006, 09:31 AM
  4. Replies: 4
    Last Post: 08-09-2006, 02:19 PM
  5. Replies: 2
    Last Post: 10-18-2005, 10:05 PM
  6. Replies: 5
    Last Post: 01-19-2005, 05:26 PM

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