Grouping and unGrouping columsI need to group and colapse view or expand group, i dont want to group a colm if it is already, how can i tell if that column is grouped and if so show or not show?  <a rel=nofollow name="vB::QuickEdit::6409747" href="http://www.dbforums.com/editpost.php?do=editpost&amp;p=6409747"></a><hr class="sig">McC© 2009 Microsoft Corporation. All rights reserved.Wed, 05 Aug 2009 05:15:59 Z5749a0db-4c5f-4d77-8ba1-09054b964e5ehttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#5749a0db-4c5f-4d77-8ba1-09054b964e5ehttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#5749a0db-4c5f-4d77-8ba1-09054b964e5eJohn Basedowhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20BasedowGrouping and unGrouping columsI need to group and colapse view or expand group, i dont want to group a colm if it is already, how can i tell if that column is grouped and if so show or not show?  <a rel=nofollow name="vB::QuickEdit::6409747" href="http://www.dbforums.com/editpost.php?do=editpost&amp;p=6409747"></a><hr class="sig">McCWed, 08 Jul 2009 15:08:34 Z2009-07-08T15:08:34Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#25ff9a60-dfa9-4d68-80cd-12a72b021ef4http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#25ff9a60-dfa9-4d68-80cd-12a72b021ef4suznalhttp://social.msdn.microsoft.com/Profile/en-US/?user=suznalGrouping and unGrouping columsTo tell if a column is grouped, use the OutlineLevel property. If the level is greater than one it is part of a group...<br/> <br/> <pre lang=x-vbnet>If Worksheets(&quot;Sheet1&quot;).Columns(2).OutlineLevel &gt; 1 Then Range(&quot;A1&quot;).Value = &quot;This column is part of a group&quot; End If</pre> This can obviously be modified to loop through all columns on a sheet or a range as you need.<br/> <br/> To Hide or unhide use ShowLevels...<br/> <br/> <pre lang=x-vbnet>ActiveSheet.Outline.ShowLevels RowLevels:=1</pre> The above will collapse all groups, leaving just Level 1 visible (level one are not part of groups).<br/> If there are three levels in the outline and you select 2 as RowLevels, level 2 will be visible but level three will be hidden (grouped).<br/> If you specify a number greater than the number of levels in an outline then all levels will be visible.<br/> <br/> This should get you started.<br/> <br/> <br/><hr class="sig">&quot;The new phonebooks are here!&quot;Thu, 09 Jul 2009 15:03:17 Z2009-07-09T15:03:17Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#d15cf9ab-05b8-4f39-8db9-d51f7193eed6http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/5749a0db-4c5f-4d77-8ba1-09054b964e5e#d15cf9ab-05b8-4f39-8db9-d51f7193eed6John Basedowhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20BasedowGrouping and unGrouping columsThanks thats exactly what i was looking for.<br/> <br/> BTW  DIE GAS PUMPER!!!!!        &lt;-- This is a joke, do not call the FBI or the MSBI or ban me from the site!<br/> <hr class=sig> McCThu, 09 Jul 2009 15:04:09 Z2009-07-09T15:07:12Z