+ Reply to Thread
Results 1 to 9 of 9

Copy data from Sheet1 to ActiveSheet

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    14

    Copy data from Sheet1 to ActiveSheet

    I have a workbook with many sheets. On each sheet is a command button with a macro assigned to it. when the button is clicked, I want data from cells A1:A10 from Sheeet1 (the data source sheet) to be copied to a selected area in the target active sheet (The active sheet is the sheet where the macro button was clicked). I don't want to duplicate this macro for every sheet that has a button. How can I word the VBA code so that the data is copied to the sheet where the button was clicked and have only one macro subroutine? Thanks.

  2. #2
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Copy data from Sheet1 to ActiveSheet

    Upload your file

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy data from Sheet1 to ActiveSheet

    Not sure I understand does this help?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-30-2013
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Copy data from Sheet1 to ActiveSheet

    Here it is.
    Attached Files Attached Files

  5. #5
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Copy data from Sheet1 to ActiveSheet

    try this

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-30-2013
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Copy data from Sheet1 to ActiveSheet

    That won't work because the macro can only copy the data from Sheets("Data") and paste it to Sheets("Sheet2"). I need the macro to paste the data in whichever sheet where the button was clicked. For example, if I click the button on Sheet3, the data should be copied to sheet3 -- not to sheet2.

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Copy data from Sheet1 to ActiveSheet

    try
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: Copy data from Sheet1 to ActiveSheet

    try this
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-30-2013
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Copy data from Sheet1 to ActiveSheet

    Bingo. Thank you.

+ 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