+ Reply to Thread
Results 1 to 3 of 3

How to optimize a group by rows macro

  1. #1
    Registered User
    Join Date
    03-19-2019
    Location
    San Francisco, CA
    MS-Off Ver
    Microsoft Office Home and Business 2016
    Posts
    2

    Question How to optimize a group by rows macro

    Hello all,

    I have pretty basic VBA knowledge and pieced this code together from a couple threads. It currently functions the way I want it to by grouping/ungrouping rows and hiding them for two Sheets depending on whether the value in the designated column equals a certain value, and ends when it hits "END". My issue is that it can sometimes take up to a minute to run... If anyone here knows a way to speed this up, I'd greatly appreciate the advice.

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 03-19-2019 at 03:40 PM. Reason: Please use code tags!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Help Speeding up Macro

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-19-2019
    Location
    San Francisco, CA
    MS-Off Ver
    Microsoft Office Home and Business 2016
    Posts
    2

    Re: How to optimize a group by rows macro

    Please see the attached workbook.

    The main differences between this and what I am using are:
    • 1. There are a greater number of rows to be grouped.
    • 2. The data in Sheet1 and Sheet2 is updated via a SUMIFS formula that changes when a key number is changed on my Key Tab. This means that the macro is also working to ungroup rows that were previously grouped based on old data which could be slowing it down???

    Lastly, why does the macro also hide the rows? When I try ungrouping everything, the ungrouped rows are still hidden. Thanks in advance
    Attached Files Attached Files

+ 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. [SOLVED] Using a group of rows with one name in a macro
    By frankday in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2018, 08:18 AM
  2. [SOLVED] Macro to group rows
    By ediman16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2015, 07:27 AM
  3. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  4. [SOLVED] Macro to group and un group rows?
    By gjjh25 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2013, 05:13 PM
  5. Replies: 6
    Last Post: 02-20-2012, 06:07 PM
  6. Optimize delete dupe rows
    By Engineers2008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2010, 04:54 PM
  7. Group rows Macro?
    By BillXT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2008, 11:24 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