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

Thread: Copy Used Range to another Workbook

  1. #1
    Board Regular
    Join Date
    Mar 2014
    Posts
    599
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Copy Used Range to another Workbook

    Seems so simple not sure what I am doing here

    trying to copy used range in Book4 to Book5 or entire sheet..

    Sheets("Sheet1").UsedRange.Copy Workbooks("Book5.xlsx").Sheets("Sheet1")

  2. #2
    Board Regular
    Join Date
    Jan 2015
    Posts
    213
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy Used Range to another Workbook

    It is actually pretty simple, but there are a few things that should be specified.
    Are trying to copy all the sheets? Is it alway going to be Book4 to Book5? It looks like book 5 is not macro enabled; that is probably okay as the macro will be in Book4. Is it always sheet1 to sheet? Do the sheets in Book5 already exist? Should any existing data in Book5 be deleted? Should data in Book5 be overwritten?

    Ken

  3. #3
    Board Regular
    Join Date
    Mar 2014
    Posts
    599
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy Used Range to another Workbook

    My apologies. I did not see your response.

    I am trying to copy one sheet from a workbook to another workbook. Yes maybe data might need to be deleted. Do not overwrite existing data.

    TY

  4. #4
    MrExcel MVP mikerickson's Avatar
    Join Date
    Jan 2007
    Location
    Davis CA
    Posts
    21,872
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Copy Used Range to another Workbook

    You need to specify the top left cell of the destination range. (And the source workbook, just to be safe.)
    Code:
    Workbooks("sourceBook.xlsx").Sheets("Sheet1").UsedRange.Copy destination:=Workbooks("Book5.xlsx").Sheets("Sheet1").Range("A1")

  5. #5
    Board Regular
    Join Date
    Mar 2014
    Posts
    599
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy Used Range to another Workbook

    Thanks mike

Some videos you may like

User Tag List

Tags for this Thread

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
  •