+ Reply to Thread
Results 1 to 2 of 2

Copy and Paste problem:macros to copy sheet form one file and paste

  1. #1
    Piotr
    Guest

    Copy and Paste problem:macros to copy sheet form one file and paste

    Hi,
    I have made macros to copy sheet form one file and paste into another,
    however somtimes there is a problem when for example I change print area
    in target file or anything else I recive a message:
    Error the target area is not the same size as the copy area what is
    starnge as area doesnt change, only solution i found is simply delete
    the file and make a new one.
    Im sure you have same problem but did you find a solution ?

  2. #2
    Earl Kiosterud
    Guest

    re: Copy and Paste problem:macros to copy sheet form one file and paste

    Piotr,

    I'm not sure what the Print Area has to do with copying and pasting. Have
    you determined for sure which statement in your code is generating the
    error? Perhaps if you post the code of the macro, and any other relevant
    information about the sheets.

    Generally, in a macro, you copy/paste like this:

    1) This method doesn't use the clipboard.
    Workbooks(Source).Sheets(Whatever).Range(Whatever).Copy Destination:=
    Workbooks(Destination).Sheets(Whatever).Range(Whatever)

    2) This method does use the clipboard.
    Workbooks(Source).Sheets(Whatever).Range(Whatever).Copy
    Workbooks(Destination).Sheets(Whatever).Range(Whatever).Paste

    In either case, it will start the paste in the upper-left cell of the
    destination range, ignoring the actual extents of that range; it pastes the
    entire range from the Copy. You need only specify the upper left cell.

    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "Piotr" <[email protected]> wrote in message news:[email protected]...
    > Hi,
    > I have made macros to copy sheet form one file and paste into another,
    > however somtimes there is a problem when for example I change print area
    > in target file or anything else I recive a message:
    > Error the target area is not the same size as the copy area what is
    > starnge as area doesnt change, only solution i found is simply delete the
    > file and make a new one.
    > Im sure you have same problem but did you find a solution ?




+ 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