+ Reply to Thread
Results 1 to 4 of 4

Need macro to copy data from one sheet and paste to many sheets

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    Pueblo, Colorado
    MS-Off Ver
    Excel 2000
    Posts
    2

    Need macro to copy data from one sheet and paste to many sheets

    I need help writing code that sorts a worksheet containing data for employees in the form of dates, and copies to multiple sheets based on the value in column "C". Employees work different units; each unit has one sheet for it's specific data.

    Problem - I have been able to get the data copied accurately, but unable to paste if the row size on both sheets is inaccurate. In addition, I have created a row just under the data that contains statistical information, that I do not want to have "pasted over" when rows are inserted. Data is pasted from another database to the sheet "All Nursing Staff" when updated. I would like to be able to assign a macro to a command button to copy and paste the data to individual sheets for each unit when updated.

    My Code:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 03-20-2013 at 12:44 AM. Reason: Added code tags, as per forum rules. Don't forget!

  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: Need macro to copy data from one sheet and paste to many sheets

    So the entire row from All Nursing Staff should be copied to its respective sheet?

    If you run the macro once and then want to enter fresh data into the All Nursing Staff page, will you clear the existing data and then enter the updated information or will you enter it in the next available row of that page?
    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
    01-17-2013
    Location
    Pueblo, Colorado
    MS-Off Ver
    Excel 2000
    Posts
    2

    Re: Need macro to copy data from one sheet and paste to many sheets

    The sheet "All Nursing Staff" stores all of the data that I then have to manually copy and paste to each individual sheet, sorted by column C. The data in "All Nursing Staff" is overwritten regulary with updated data from another spreadsheet. What I want to do is write a macro that runs from a command button and loops through the "All Nursing Staff" sheet and copies entire rows and pastes them to all of the other sheets based on the unit designation in column C. I have been able to do this, however when there are more rows in the "All Nursing Staff" sheet than in the sheet being pasted to, the row of statistics at the bottom of each sheet is overwritten. I have put a great deal of time into this without finding a solution. Any help you could lend would be greatly appreciated.

  4. #4
    Registered User
    Join Date
    03-06-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Need macro to copy data from one sheet and paste to many sheets

    Please Login or Register  to view this content.
    paste this as much as u like and remember change the sheet name

+ 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