Group/Ungroup in VBA 
Author Message
 Group/Ungroup in VBA

does anyone know how to use the 'group' and 'ungroup'
feature for grouping rows in excel using vba? i've tried
recording a macro but it comes up with :

ExecuteExcel4Macro "SHOW.DETAIL(1,17,TRUE,,26)"

but i can't seem to enter these numbers using variables.

is there a way to do this without using the excel4macro
thing?

thanks
Tony



Sat, 12 Mar 2005 23:30:32 GMT  
 Group/Ungroup in VBA
Using XL97, this does the job. ActiveSheet.Rows("15:20").Group

You can substitue variables in Rows() if you make it all a single string :-

'-----------------------------------------
Sub MyGroup
    r1 = ActiveSheet.Range("A1").Value
    r2 = ActiveSheet.Range("A2").Value
    ActiveSheet.Rows(r1 & ":" & r2).Group
End sub
'------------------------------------------

Regards
BrianB
================================================

Quote:

> does anyone know how to use the 'group' and 'ungroup'
> feature for grouping rows in excel using vba? i've tried
> recording a macro but it comes up with :

> ExecuteExcel4Macro "SHOW.DETAIL(1,17,TRUE,,26)"

> but i can't seem to enter these numbers using variables.

> is there a way to do this without using the excel4macro
> thing?

> thanks
> Tony



Mon, 14 Mar 2005 21:54:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Excel 2000: Group and Ungroup in VBA

2. Group/UnGroup Protected Worksheet

3. Macro (or something) to group and ungroup sheets?

4. Group/Ungroup in 2000

5. group and ungroup Excel 2000

6. Rep: outline : group & ungroup

7. outline : group & ungroup

8. Event to ungroup what has been grouped

9. Can you protect a worksheet AND group/ungroup?

10. Protect sheet without losing group/ungroup ability?


 
Powered by phpBB® Forum Software © phpBB Group