+ Reply to Thread
Results 1 to 15 of 15

Macro to hide rows to slow

  1. #1
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Macro to hide rows to slow

    Hello,

    I have this macro that unhides all rows, then rehides the rows that column A have 0 in them, it works it is just really slow. My question is there a faster code that will do the same as this? the code i have is:

    Please Login or Register  to view this content.
    Thanks for any help!
    Last edited by alansidman; 11-15-2013 at 11:26 AM. Reason: code tags added

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to hide rows to slow

    Probably easiest to hide them all at once:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Macro to hide rows to slow

    Using autofilter will be faster.

  4. #4
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    To yudlugar,

    When I run this code i get Compile Error: Invalid Qualifier.

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to hide rows to slow

    sorry should be application.calculation = xlautomatic not application.calculation.xlautomatic.

    I always seem to get like this late on a friday...

  6. #6
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    To Izandol,

    How would I go about doing that?

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Macro to hide rows to slow

    @mort.marshall.20

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you today. Please read all the forum rules and comply with them in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  8. #8
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    Yudlgar,

    Thank you for your help! That got rid of that error but now i get a Run-Time error :424': Object Required...Any Suggestions on that?

  9. #9
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    @ Alan,

    Sorry about that, i will make sure i do that in the futuer, and thank you!

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to hide rows to slow

    Try:
    Please Login or Register  to view this content.
    (I added the autofilter option also as a second macro)

  11. #11
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    @ Yudlugar, That code is very fast, but i only have 1 issue with it, if 1 of the cells are already hidden and the value changes then it dont caclulate the change. Is there a fix to this as well?

  12. #12
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to hide rows to slow

    As in, you want it to re-run everytime a value changes automatically? or when you run it it leaves ones that were hidden but now shouldn't be, still hidden? Are you referring to hiderows() or hiderows1()

  13. #13
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    @yudlgar,Yes to you second question and Hidrows(). Thank you!

  14. #14
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to hide rows to slow

    You could try this instead but I don't see what would cause that to happen...
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    11-12-2013
    Location
    Winslow, Arkansas
    MS-Off Ver
    Excel 2016
    Posts
    62

    Re: Macro to hide rows to slow

    @Yudlugar,

    Thank you very much for all your help, I realized that i had the paticular rows that were not coming up at a row height of 0. Lol. Your macro works great!

+ 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. Worksheet_Change(ByVal Target As Range) to hide rows is very slow!
    By AttalaEA in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2017, 12:12 PM
  2. [SOLVED] very slow macro (delete blank rows)
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2013, 04:13 AM
  3. Slow Macro - Hide Row based on cell value
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-08-2013, 08:52 AM
  4. [SOLVED] Hidding Rows Macro Runs Very Slow
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-13-2012, 10:55 AM
  5. macro that hides rows run slow
    By yoav_b in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-15-2007, 11:16 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