+ Reply to Thread
Results 1 to 10 of 10

Simple Copy Paste Macro

  1. #1
    Registered User
    Join Date
    06-17-2007
    Posts
    8

    Simple Copy Paste Macro

    I have a really large excel file (90 Megs) And i want to copy the values and formats of certain sheets to another workbook. Ive tried using a copy/paste macro i had from work but the sheets have alot of groups and info so it kept freezing

    Can anyone help me?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I would create a template for ease -see this

    failing that why not simply use the copy the whole sheet?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    Its for work, so i need to run this every week and one copy paste macro would help. The other one we used to use doesnt work, i dont know why but if anyone can just paste some code that would copy specific worksheets' values and formats into a new book

  4. #4
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    anyone? ? ?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Are you copying values or formulas? Which sheets need copying.

    You could either save the existing workbook as a new name & delete any unnecessary sheets or as I said copy specific sheets to a new workbook.

    For example

    Please Login or Register  to view this content.
    Last edited by royUK; 06-22-2007 at 02:37 AM.

  6. #6
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    I still have this problem, I need to copy like 10 sheets To a new workbook. I don't want to save the work sheet because that will take too much time. I just want to copy Values and formats to a new work book for specific sheets.

    ive tried this

    Sheets(Array("Sheet1", "Sheet2")).Select
    Sheets("Sheet1").Activate
    Sheets(Array("Sheet1", "Sheet2")).Copy
    application.CutCopyMode = False

    Sheets("Sheet1").Select
    Cells.Select
    selection.Copy
    range("D1").Activate
    selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    range("A1").Select
    application.CutCopyMode = False


    Dim SaveDate
    SaveDate = Date$

    ActiveWorkbook.SaveAs Filename:="D:Workbook " & SaveDate & ".xls" _
    , FileFormat:=xlNormal, password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False

    range("A17").Select

    The problem with this is, the computer I do it on is too slow, so it just freezes up because of the array at the top. how can i do each sheet at a time??

  7. #7
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    The code in the middle i do for each sheet in the array, can anyone help?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why do you think my suggestion will take more time than copying & pasting, especially as your code is selecting before copying, then activating ranges ? Selecting & copying are not necessary and will slow your code.

  9. #9
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    That code i posted above is the old copy paste macro that im trying to fix. The problem with what you posted is that although it deletes the unwanted sheets. It retains the formulas in the sheets that are there. I want to just copy the values and formats. If I retained the formulas it would make the file size too big. Can you edit your code to copy paste just the values and formats?

  10. #10
    Registered User
    Join Date
    06-17-2007
    Posts
    8
    anyone??>?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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