+ Reply to Thread
Results 1 to 4 of 4

Macro to copy data, open new workbook and paste data there

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    119

    Macro to copy data, open new workbook and paste data there

    Hi guys.
    Need some help with a code that does the following:

    1- Copy a dynamic range of data (starts in column "BQ2" and could have more or less rows and columns, so it should copy till there arenīt more data, up and down)
    2- Open a new workbook.
    3- Paste this data with the same formats (there are dates and numbers) and in the same order, starting on cell "B2" in this new workbook.


    Thanks in advance

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to copy data, open new workbook and paste data there

    Hi,

    Untested in the absence of a workbook but perhaps

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Macro to copy data, open new workbook and paste data there

    Hi Richard and thanks for the reply. So i try your code and it gives me "run time error 1004. PasteSpecial method of Range class failed.

    Sorry im really noob in VBA. I just change 'Sheet1' to the name of the sheet i have, could it be this change?
    One thing i notice is that my active sheet has all sheet selected probably to paste when it should be just "BQ" and all the columns and rows that have data in.

    Thanks again
    Last edited by bazofio; 01-26-2015 at 10:17 AM.

  4. #4
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Macro to copy data, open new workbook and paste data there

    OK so i try just to copy a designated range and its working.
    This is the code i use:
    Please Login or Register  to view this content.
    What i want was to just copy the columns and rows that have data, starting in "BQ2". Can this be done?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro VBA to copy and paste cells from one open workbook to another open workbook
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2014, 07:55 PM
  2. Replies: 0
    Last Post: 05-08-2013, 02:47 PM
  3. [SOLVED] Copy selected range of data and paste in new open workbook
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 03:41 AM
  4. Replies: 6
    Last Post: 01-29-2013, 07:01 AM
  5. [SOLVED] Macro to copy data from open workbook to next open line of new workbook
    By nhtodd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2012, 09:42 PM

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