Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Copy Sheets

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am using the following code to copy a worksheet:

    ActiveSheet.Copy Before:=Sheets("Main Menu")

    It is extremely slow in doing so. Is there better code I can be using to speed things up? I already have screen updating and calculation turned off.
    Thanks in advance,
    Patrick

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does the worksheet that you are copying contain a lot of data?

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No not a tremendous amount. Last column used is AB. Last row used is 50. Should I maybe try deleting all of the blank rows and columns. There are about 4 buttons on the sheet however.
    Thanks in advance,
    Patrick

  4. #4
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    As a rule of thumb, the less amount of formatting that you have to copy the faster it will be.

    If there weren't any buttons I was going to ask you to try the following (not sure if it is faster though):

    Sheet2.Range(Sheet1.UsedRange.Address).Value = Sheet1.UsedRange.Value

    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The new sheet is not there until I copy the old one. I do not have any extra sheets to copy into.
    Thanks in advance,
    Patrick

  6. #6
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sheets.Add will add a blank sheet.

  7. #7
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for all of the help so far. I would like to try first adding the blank sheet then setting its values equal to the other sheet.

    However, how do I deal with the buttons?
    Thanks in advance,
    Patrick

  8. #8
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The following will do it:

    ActiveSheet.Shapes.SelectAll
    Selection.Copy
    Sheet2.Activate
    ActiveSheet.Paste

    But it won't keep them in the same place.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  9. #9
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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