Results 1 to 5 of 5

Thread: [RESOLVED] Grouping multiple selections

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Resolved [RESOLVED] Grouping multiple selections

    Is it possible with VBA to group rows that are not contiguous; i.e., based on some criteria within the row? I'd like to group, for example, rows 1, 2 and 4 and exclude row 3 from the grouping? After grouping, I'd like the user to be able to view certain group levels using the standard group level selection (1, 2, etc.)

    Thanks.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Grouping multiple selections

    you can try this using union to create a noncontiguous range then select the range
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Grouping multiple selections

    Thanks for suggestion. I've already done that, but was wondering if there was a way to group rows as you do in Excel and then are able to select different outlining levels. When you try to manually group non-contiguous rows, Excel won't allow it. I was hoping you could get around that with VBA.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Grouping multiple selections

    i am not sure if you can define a named range from a noncontiguous range
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Grouping multiple selections

    That's okay. I've coded a replacement routine that should do the trick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width