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 |
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 |
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 |
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 |
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); } } |
All times are GMT +1. The time now is 11:24 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com