Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

Programming Outline Expand(+) / Collapse(-) Functionality

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen - 23 Jan 2008 02:13 GMT
What is the vba code for expanding and collapsing a range of columns or rows?
I want my program to expand a group of columns, print a named range, and
then collapse it once again.

Any suggetions would be greatly appreciated.

Thanks!
Signature

Stephen

Otto Moehrbach - 23 Jan 2008 02:42 GMT
What do you mean by "collapsing" and "expanding".  Hiding and unhiding?
Otto
> What is the vba code for expanding and collapsing a range of columns or
> rows?
[quoted text clipped - 4 lines]
>
> Thanks!
Stephen - 23 Jan 2008 04:37 GMT
Otto,

My spreadsheet contains outlined data.  I use the "1" and "2" boxes in the
upper left hand corner to hide / display the columns I have grouped.  
Alternately, I could click the "+" /"-" above the outlined columns to
unhide/hide these columns.  

I grouped these columns with the Data...Group and Outline menu command

Thanks for taking the time to respond.

Signature

Stephen

> What do you mean by "collapsing" and "expanding".  Hiding and unhiding?
> Otto
[quoted text clipped - 6 lines]
> >
> > Thanks!
Matthew Pfluger - 14 Feb 2008 21:38 GMT
Use Application.Outline.ShowLevels RowLevels:=x, ColumnLevels:=y

HTH,
Matthew Pfluger

> Otto,
>
[quoted text clipped - 17 lines]
> > >
> > > Thanks!
serhio - 22 Apr 2008 12:13 GMT
Use the "Group" method, row by row, or a entire range

               for (int i = upperRowNumber; i <= lowerRowNumber; i++)
               {
                   cellA = savedWorksheet.get_Range(string.Format("{0}{1}",
ACellName, i), Missing.Value);
                   cellB = savedWorksheet.get_Range(string.Format("{0}{1}",
BCellName, i), Missing.Value);

                   if (cellA.Value2 == null)
                   {
                       if (cellB.Value2 != null)
                           (savedWorksheet.Rows[i, Missing.Value] as Range).
                               Group(Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
                   }
               }
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.