ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy row grouping from one worksheet to another (https://www.excelbanter.com/excel-programming/425011-copy-row-grouping-one-worksheet-another.html)

[email protected]

Copy row grouping from one worksheet to another
 
Every month I get a new P&L template that can add or take away
accounts (rows) which are grouped
(data-group) and formatted. What I'm trying to do is copy the
formatting and grouping to a new worksheet without copying the whole
worksheet If I copy the whole worksheet, the grouping comes over but
destroys my formulas. Is there a way to programmatically copy the row
grouping from one workheet to another?

ryguy7272

Copy row grouping from one worksheet to another
 
Perhaps something liek this:

Sub Macro()
Cells.Select
Selection.Copy
Windows("Book1").Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub

Always make a backup of your data before trying anything new!!


Regards,
Ryan---
--
RyGuy


" wrote:

Every month I get a new P&L template that can add or take away
accounts (rows) which are grouped
(data-group) and formatted. What I'm trying to do is copy the
formatting and grouping to a new worksheet without copying the whole
worksheet If I copy the whole worksheet, the grouping comes over but
destroys my formulas. Is there a way to programmatically copy the row
grouping from one workheet to another?



All times are GMT +1. The time now is 02:17 AM.

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