ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   grouping (https://www.excelbanter.com/excel-programming/441718-grouping.html)

dan

grouping
 
I am copying some rows from one sheet to another, how can I also copy the
grouping (DataGroup and OutlineGroup)?
Is it at all possible?
Thanks,
Dan

Colbert Zhou [MSFT]

grouping
 
Hello Dan,

When we do paste in Excel, we have some paste special options from the
ribbon(2007), Home-Clipboard-Past-Paste Values and Number Formatting.
Using this option should let us copy both of the data and rows' grouping
information. I record a VBA macro and see the codes as follows,
--------------------------------------
Sub Macro1()
'
' Macro1 Macro
'

'
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme,
Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

--------------------------------------

Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support



All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com