Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 21

Thread: Copy data from Multiple to SINGLE worksheet.

  1. #1

    Copy data from Multiple to SINGLE worksheet.

    I want to copy data from multiple worksheets into MASTER worksheets. Can anyone help please?
    User clicks a button and it copies data into MASTER from all worksheets. I have attached the test template.
    Thanks


  2. #2
    File attached.

  3. #3
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Try this Tex. You have to delete the master sheet because it is created by the script.

    I deleted your Master but it looked like it had some code where you were trying to get this to work........let me know how close we are....
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    VBAX Tutor david000's Avatar
    Joined
    Mar 2007
    Location
    Chicago
    Posts
    276
    Location

    Sweet!

    let me know how close we are....


    I would delete all but rows 1:2 above the try me button first. i.e get rid of the extra headers.
    Last edited by david000; 06-12-2008 at 02:35 PM. Reason: i had a key remapped and really botched this up!

  5. #5
    i want to give a button on master worksheet on right hand side. the data will flow to master worksheet and pull corresponding data from all worksheets on clicking this button. how do i do that? I am confused. and i am new to vba.

  6. #6
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Maybe like this......?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7

    Error

    Hi Lucas

    I get an error message. See the attached file. Its on

    CommandBars("My Toolbar").Delete

    This code of line.

    Also, how do I populate the date and time on the last column in Master worksheet. That will be the date and time when the macro is run each time.

    Can you please help!



  8. #8

    button added

    Hi

    i have attached the file. and the button on MAIN Worksheet.

    thanks
    Last edited by zebradoby; 06-16-2008 at 08:47 AM.

  9. #9
    I fixed the error. Thats all i need for now:

    How do I populate the date and time on the last column in Master worksheet. That will be the date and time when the macro is run each time.

    To Run: Click button MAIN Worksheet.


    Can you please help! Latest File is attached.

  10. #10

    Latest file is attached.

    Latest file is attached.


    How do I populate the date and time on the last column in Master worksheet. That will be the date and time when the macro is run each time.


    To Run: Click button on MAIN Worksheet.


    Can you please help! Latest File is attached
    Last edited by zebradoby; 06-16-2008 at 10:19 AM.

  11. #11
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    You keep asking for the last column for the date but I believe you mean the last row......see attached.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  12. #12
    Can we display the date and time below the button on Main worksheet used to run the macro?

  13. #13
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    yes, you just reference the sheet main and the cell that you want to put the date in and make it's value = to Now

    [VBA] Sheets("Main").Range("C6").Value = Now[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  14. #14
    i did this..it RESOLVED it.

    Sheets("Main").Select
    ActiveCell.FormulaR1C1 = ""
    ActiveCell.FormulaR1C1 = "=NOW()"
    Range("C10").Select

  15. #15
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Looks like you found your macro recorder......good. You should take a look at the code I posted as all of the extra selects are unnecessary. Another thing in your code when you select the sheet.....which cell is selected? If if is not the one you want the date in then the wrong cell will get the date.....

    compare my code to yours and see if you can understand what is going on. Good to see you are learning something from the exercise.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  16. #16
    it updates date into where the cursor was last along with c10. how do i get it ONLY on c10 on main worksheet.

  17. #17
    i am good disregard my last posting.

  18. #18

    DEFECT-NEED HELP!!!!

    Hi LUCAS

    The last row saved on running the macro is same as HEADER row in MASTER. Can we fix that? See attached file. We do not want to repeat the HEADER row at the bottom again.


    THANKS

  19. #19
    VBAX Tutor david000's Avatar
    Joined
    Mar 2007
    Location
    Chicago
    Posts
    276
    Location
    The last row saved on running the macro is same as HEADER row in MASTER. Can we fix that? See attached file. We do not want to repeat the HEADER row at the bottom again.
    You have a sheet named "Unknown" on that sheet you have no data in column "A" - as a result, it's causing the first row to be copied over do to the nature of the code. Put some data in that column and it will work.

    In your situation column A is mandatory!
    Last edited by david000; 06-17-2008 at 07:07 AM.

  20. #20
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Yep, sheet unknown is the culprit. Delete it and run the code to see what David is talking about.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •