Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Expand Collapse Buttons | Excel Discussion (Misc queries) | |||
Protect worksheet but expand and collapse outline? | Excel Discussion (Misc queries) | |||
Programming Outlines (expand/collapse rows) in Excel | Excel Programming | |||
Outline, expand or collapse via VBA | Excel Programming | |||
Expand and Collapse Columns | New Users to Excel |