+ Reply to Thread
Results 1 to 8 of 8

Loop through rows to see if they are hidden or not and change

  1. #1
    Registered User
    Join Date
    09-18-2009
    Location
    Grand Forks, North Dakota
    MS-Off Ver
    Excel 2007
    Posts
    41

    Loop through rows to see if they are hidden or not and change

    Hello Everyone,

    I am looking for a way to loop through a set of rows...row 9 through row 500 and be able to tell if it's property is set to hide and if it is set it to unhide. Any help is much appreciated.


    Justin

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Loop through rows to see if they are hidden or not and change

    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Loop through rows to see if they are hidden or not and change

    Oops - you just want to see whether or not they are hidden? How would you like this reported? This will give you a count of each type:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-18-2009
    Location
    Grand Forks, North Dakota
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Loop through rows to see if they are hidden or not and change

    Ok soooooooooooooooo unhiding all of them takes FOREVER lol sorry had to yell a bit today it's friday :-) Is there a way to check quickly then only unhide if they are hidden?

  5. #5
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Loop through rows to see if they are hidden or not and change

    I'm betting the use of the variant variable is the culprit. Following uses a collection. See if this is faster:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-18-2009
    Location
    Grand Forks, North Dakota
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Loop through rows to see if they are hidden or not and change

    Hmmmmmmmmmmm still put put put slowwwww :-) So the fastest way seems to be just to hide all then show all rows. I might just have to stick with two buttons until 2010's bug is fixed. The probilem I have is excel 2010 has a bug that when you remove the filters in totality on the whole sheet it takes your text boxes and stacks them on top of eachother in A1....I know....great right lol....so the only way to get around this is to hide all the rows then unhide them from what I can figure out. So I think I might just need to hide all then unhide I'm thinking as that is super fast 8-)

  7. #7
    Registered User
    Join Date
    09-18-2009
    Location
    Grand Forks, North Dakota
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Loop through rows to see if they are hidden or not and change

    omg..........you can just use

    [CODE]
    Rows("9:500").Hidden = True
    Rows("9:500").Hidden = False
    [\CODE]

    I can't believe I never thought of just stacking the two lines of code...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    Thank you so much for your assistance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If you are ever in Grand Forks, ND shoot me a message and we'll have a beer or three :-)


    justin

  8. #8
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Loop through rows to see if they are hidden or not and change

    Hey - I'd settle for a good cup of coffee...after a long day of looking at code, you can get rummy and miss things you'd ordinarily see otherwise. Glad to help!

    Cheers!
    Tom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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