+ Reply to Thread
Results 1 to 12 of 12

Macro - Copy Specific Cells in 1 workbook and paste in another.

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Macro - Copy Specific Cells in 1 workbook and paste in another.

    Hi guys,

    I am not too good with macros, so please help.

    I am designing 2 spreadsheets and to help transfer numbers from 1 spreadsheet to another I need a macro which will help me do that.

    I would probably need 8 macros, as I need:
    - To copy particular cells (not the whole row) from Row 6, 8, 11, 14 separately (i.e there needs to be an option to copy cells from row 6, but not 8 etc)

    - To paste to a particular place in the other spreadsheet (i.e. if I copied cells from row 6 is spreadsheet 1, I would need to paste it in the identical place in spreadsheet 2).

    Let me know whether this is feasible please.

    Many thanks,

    Peter
    Attached Files Attached Files
    Last edited by liybpg; 07-12-2012 at 07:05 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Welcome to the forum, Peter.

    Why dont you attach a sample file?

    To Attach a File:

    1. Click on Go Advanced.
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Thanks Arlette, I have now attached it to the original post.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Could you explain this
    To copy particular cells (not the whole row) from Row 6, 8, 11, 14 separately (i.e there needs to be an option to copy cells from row 6, but not 8 etc)
    What do you mean by copy 6 but not 8?

  5. #5
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    What I meant was that I need to be able to copy 4 different sets of cells separately. As in: option to copy only cells in row 6, then only cells in row 8 etc.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Ok, in that case, you do not need 8 separate macros. All you need to do is select the data and then run the macro. The macro will pick up your row numbers and copy them to the corresponding row numbers in the other file.

    Will this work?

  7. #7
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Do you mean that this would need to be done every time I want to copy?

    The problem is that I am designing this for a relatively excel-illiterate population and that would probably make it complex. Also, another complication is that the second file is saved centrally on sharepoint so not that easy to change.

    Not sure if this is unrealistic to do. If yes, then not to worry, I will think of something else.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Quote Originally Posted by liybpg View Post
    What I meant was that I need to be able to copy 4 different sets of cells separately. As in: option to copy only cells in row 6, then only cells in row 8 etc.
    On 2nd thoughts, maybe i didnt understand this part initially, are you trying to say you do not want to copy the cells in row 7 but copy the cells in row 6 first and then copy the cells in row 8? But everything should be in 1 macro.

  9. #9
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    No, not quite. Apologies, I will try to explain clearer.

    I have 2 spreadsheets (they are the same, but stored in different places). The idea is that spreadsheet 1 gets populated with figures only, say, in some cells in row 8 (other cells in row 8 are under formulas and protected, so cannot be touched).

    What I need is to be able to easily copy some cells from row 8 from spreadsheet 1 and then paste them in exactly the same place (i.e. same cells in row 8) in spreasheet 2.

    I also need to be able to do exactly the same thing, but for a different row (i.e. copy some cells from row 11 in sheet 1 and paste to sheet 2 in exactly the same place.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Ok, this part is understood.

    So should the copy paste to all rows happen at the same time?

  11. #11
    Registered User
    Join Date
    07-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    No, not a the same time, but there needs to be an option to copy one set of cells (e.g. on row 8) and then paste them in the same place (i.e. row 8)on anoter sheet.

    The reason that rows need to be able to be copied separately is because sheets will be filled out by different people at different times and person who for example fills in row 8, should only copy-paste data in row 8.

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro - Copy Specific Cells in 1 workbook and paste in another.

    Ok, i can provide you a macro that will do the copy paste once the button is pressed.

    But you said there are multiple rows. So should the macro just take the row number which the user selects? In other words, will it be ok if the user selects the area or the row to be copied and then triggers the button? Then the macro will do the copy paste.

+ 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