+ Reply to Thread
Results 1 to 7 of 7

Macro to group and un group rows?

  1. #1
    Forum Contributor
    Join Date
    09-06-2011
    Location
    manchester england
    MS-Off Ver
    Office 365
    Posts
    307

    Macro to group and un group rows?

    I do a lot of construction pricing work which tends to have a lot of repetitive item in the list to be priced.

    I was wondering is there a way to temporarily group the items together so it easy to enter the rate and then restore the list to how it should be.

    So in the enclosed example I have highlighted the dispose on site, could I for example select this cell and then have a macro to bring all the same rows together so I can enter the price and then put the rows back in the correct place. Then move on to another cell that has repeated items and do the same?
    Attached Files Attached Files
    Last edited by gjjh25; 12-12-2012 at 07:04 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to group and un group rows?

    hi gjjh25, I hope I get your idea correct, select non-empty cell in B column and press "ALT+UP arrow", after changes have been made press "ALT+DOWN arrow"
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    09-06-2011
    Location
    manchester england
    MS-Off Ver
    Office 365
    Posts
    307

    Re: Macro to group and un group rows?

    Watersev,

    That is exactly what I was looking for thank you.

    One last question how do I get it to work on any new excel document I receive please?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to group and un group rows?

    Among the simplest options:
    1. Move sheets from different workbook to this one and use it as you would like, move back
    2. The feature uses two main codes: AFon and AFoff. You can copy them to a Personal macro book (if it does not exist you can create it. The other two codes that assign actions to key combinations are sitting in ALT+F11 - ThisWorkbook. You will need to transfer them into Personal macro book into Thisworkbook and save it.
    Last edited by watersev; 12-12-2012 at 06:48 AM.

  5. #5
    Forum Contributor
    Join Date
    09-06-2011
    Location
    manchester england
    MS-Off Ver
    Office 365
    Posts
    307

    Re: Macro to group and un group rows?

    Thank you I have Created a Blank master for this sheet which I think is easiest.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to group and un group rows?

    hi Graham, option to make it, for example, 4 lower rows visible after grouping. The key combinations are the same: [ALT+UP Arrow] to group and [ALT+DOWN arrow] to ungroup. After pressing [ALT+UP Arrow] please note outline markers on the left: 1 and 2. If you press 2 you will see those 4 rows under each grouped header. Please test it if it suits your needs.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to group and un group rows?

    4 below + 4 above
    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)

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