+ Reply to Thread
Results 1 to 4 of 4

Copy Macro - while maintaining grouping

  1. #1
    Registered User
    Join Date
    02-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Copy Macro - while maintaining grouping

    Hi:

    I have create a macro to copy the contents of one sheet to another. My intention is to maintain all the formats, including the grouping. I have achieved most of what I want, with the exception of the groups/outlines. When I copy over, all the information is gone. Any help is much appreciated.

    I have included a sample sheet as an example. Press the button on the "Command" sheet will active that marco, which suppose to copy contents from the "Original" sheet to the"Output" sheet.

    Thanks in advance.

    Norman
    Attached Files Attached Files
    Last edited by nwong1288; 02-23-2010 at 03:19 PM.

  2. #2
    Registered User
    Join Date
    02-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Copy Macro - while maintaining grouping

    I have create a macro to copy the contents of one sheet to another. My intention is to maintain all the formats, including the grouping. I have achieved most of what I want, with the exception of the groups/outlines. When I copy over, all the information is gone. Any help is much appreciated.

    I have included a sample sheet as an example. Press the button on the "Command" sheet will active that marco, which suppose to copy contents from the "Original" sheet to the"Output" sheet.

    Thanks in advance.

    Norman
    Attached Files Attached Files

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Copy Macro - while maintaining grouping

    Not sure I understan your problem properly but perhaps a macro like this:

    Sub Macro1()
    '

    Application.DisplayAlerts = False
    Sheets("Output").Delete
    Sheets("Original").Copy After:=Sheets(2)
    Sheets("Original (2)").Name = "Output"
    Application.DisplayAlerts = True
    End Sub

  4. #4
    Registered User
    Join Date
    02-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    [SOLVED] Copy Macro - while maintaining grouping

    I found a way to do this. Basically, instead of selecting a range, I copy by selecting Rows first. Then I paste over the same sheet with other attributes. This way, Excel maintains all the row groups. Here are my new codes. I don't know what to do if there were both rows and column groups. I suspect I could just copy the entire sheet first.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1