|
-
Nov 2nd, 2010, 11:21 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Nov 2nd, 2010, 03:47 PM
#2
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
-
Nov 2nd, 2010, 04:58 PM
#3
Thread Starter
Hyperactive Member
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.
-
Nov 2nd, 2010, 09:05 PM
#4
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
-
Nov 3rd, 2010, 11:59 AM
#5
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|