Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Programming Outline Expand(+) / Collapse(-) Functionality

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!
--
Stephen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Programming Outline Expand(+) / Collapse(-) Functionality

What do you mean by "collapsing" and "expanding". Hiding and unhiding?
Otto
"Stephen" wrote in message
...
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!
--
Stephen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Programming Outline Expand(+) / Collapse(-) Functionality

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.


--
Stephen


"Otto Moehrbach" wrote:

What do you mean by "collapsing" and "expanding". Hiding and unhiding?
Otto
"Stephen" wrote in message
...
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!
--
Stephen




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Programming Outline Expand(+) / Collapse(-) Functionality

Use Application.Outline.ShowLevels RowLevels:=x, ColumnLevels:=y

HTH,
Matthew Pfluger

"Stephen" wrote:

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.


--
Stephen


"Otto Moehrbach" wrote:

What do you mean by "collapsing" and "expanding". Hiding and unhiding?
Otto
"Stephen" wrote in message
...
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!
--
Stephen




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Programming Outline Expand(+) / Collapse(-) Functionality

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);
}
}
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expand Collapse Buttons Keith H[_2_] Excel Discussion (Misc queries) 0 April 17th 09 08:47 PM
Protect worksheet but expand and collapse outline? Trini_Suize Excel Discussion (Misc queries) 1 September 8th 08 11:57 PM
Programming Outlines (expand/collapse rows) in Excel [email protected] Excel Programming 0 January 17th 07 10:33 PM
Outline, expand or collapse via VBA Kevin McCartney Excel Programming 1 May 10th 06 04:31 PM
Expand and Collapse Columns JVICO New Users to Excel 1 April 21st 06 02:13 AM


All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"