+ Reply to Thread
Results 1 to 8 of 8

Recording macro to copy the data from one worksheet to another worksheet

  1. #1
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Recording macro to copy the data from one worksheet to another worksheet

    Hello guys.

    Here is my problem.I got two worksheets. You can refer to attachment.

    1) Sheet1 is for the filteration .It will be updated,filtered and erased everyday.
    2) Sheet2 for the database list. List of data here will be maintained and kept for long period.


    I want to record a micro that can select the active cell on 'sheet1' and copy them. Then it will automatically pasted on 'sheet2'. It works for the first time.


    However, when i run the macro again , it doesnt well like what i want. I need those copied active cell in sheet1 to be ontinuously added up just below the active cell of previous list (in sheet2) every time i hit the button. It means it doesnt erase or be redundant with the previous data .

    Can anyone help me on this. Appreciate your help.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-19-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    67

    Re: Recording macro to copy the data from one worksheet to another worksheet

    Hi,

    Please change code as below:

    Please Login or Register  to view this content.
    Regards

    Jack

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

    Re: Recording macro to copy the data from one worksheet to another worksheet

    Pyol17 & Jack,

    Try avoiding the select and activate statements. Try this code
    Please Login or Register  to view this content.
    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]

  4. #4
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Recording macro to copy the data from one worksheet to another worksheet

    It works.Thread solved.

    Thanks both of you anyway.

    ---------- Post added at 10:44 PM ---------- Previous post was at 07:20 PM ----------

    Dear arlu1201,

    i got one late request. What if i want to copy data from sheet 1, to sheet2 and sheet3 at one time. Which part of your code that i need to modified.

    Thanks in advance

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

    Re: Recording macro to copy the data from one worksheet to another worksheet

    Where should the data from sheets 1,2 and 3 be copied to?

  6. #6
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Recording macro to copy the data from one worksheet to another worksheet

    just same with previous requirement.

    Copy from : The active cell
    copied to : just below the active cell, of previous data


    I guess the code will be similar. The only different is i want it to be copied from worksheet1 to worksheet2 and worksheet3 at the same time. Thats all.

    i tried to modify your code, but it doesnt work . A lot more to learn for me.

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

    Re: Recording macro to copy the data from one worksheet to another worksheet

    Use this code
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Recording macro to copy the data from one worksheet to another worksheet

    Dear Arlu.

    Your code working fine. No problems at all. Unless here i try to modify it ( i have to) , so it will copy from sheet1 of workbook1 , to sheet 1 of workbook2. Can i?

    (the position of the table where the data will be copied from, or where it will be copied to just similar to previous requirement. Doesnt change)


    Thanks for helping.

+ 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