+ Reply to Thread
Results 1 to 8 of 8

Updating worksheet and move data to another worksheet

Hybrid View

MrChiss Updating worksheet and move... 09-15-2015, 04:56 AM
owenaldridge Re: Updating worksheet and... 09-15-2015, 05:18 AM
MrChiss Re: Updating worksheet and... 09-15-2015, 06:21 AM
owenaldridge Re: Updating worksheet and... 09-15-2015, 06:53 AM
MrChiss Re: Updating worksheet and... 09-15-2015, 07:14 AM
owenaldridge Re: Updating worksheet and... 09-15-2015, 08:19 AM
MrChiss Re: Updating worksheet and... 09-15-2015, 08:51 AM
owenaldridge Re: Updating worksheet and... 09-15-2015, 09:49 AM
  1. #1
    Registered User
    Join Date
    09-15-2015
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2010
    Posts
    4

    Question Updating worksheet and move data to another worksheet

    Hi guys,

    I have a problem with my newest project. I will try to explain:

    A)
    I have an existing worksheet named "Existing data" with (let us say) 2 columns ("RecordID" and "SomeDate") and 10 rows. I would like this sheet to be updated with data from my sheet "New data" with the same number of columns as the previous. This new sheet will always have more rows than the previous. I would like to compare these two sheets. Compared by "RecordID" and if the "SomeDate" is newer than in the existing data OR if it is a new "RecordID", I need a vba code to:

    1) Copy the headline + the "New data" row to a new sheet called: "Updated data".
    2) Replace the "Existing data" row with the "New data" row.

    B)
    The headline + row replaced in 2) should be copied to a sheet called "Traceability".

    For some reason,maybe lack of experience or Tuesdays(!), I can't figure this out...

    Does anyone have some guidance, links, codes or constructive advise? It will be much appreciated!
    Attached Files Attached Files
    Last edited by MrChiss; 09-15-2015 at 06:20 AM.

  2. #2
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Updating worksheet and move data to another worksheet

    Hi MrChiss,

    Are you able to upload an example of the spreadsheet, as it makes it easier to understand what is required.

    Thanks

    Owen

  3. #3
    Registered User
    Join Date
    09-15-2015
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2010
    Posts
    4

    Re: Updating worksheet and move data to another worksheet

    Hi owenaldridge,

    I have uploaded a file on how I want the outcome to be like. Hope it makes it more clear.

    Chiss

  4. #4
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Updating worksheet and move data to another worksheet

    Hi Chiss,

    Just so I understand, can I ask why the "new data" cannot replace the "existing data"?

    Will there sometimes be a date that is older on the "new data" that cannot replace the "existing data"?

    Otherwise I think I know what you require:
    1. Update existing table if "new data" has new record or a more recent date of an existing record
    2. Place the updated existing records into "Traceability"
    3. Place all updated records into "Updated data"

    Is this correct?

    Owen

  5. #5
    Registered User
    Join Date
    09-15-2015
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2010
    Posts
    4

    Re: Updating worksheet and move data to another worksheet

    Hi owenaldridge,

    Yes of course. The reason for this comes in two parts. First and most important, the entire workbook needs to be validated by the FDA standards. Second there might be some cell colors in the "Existing data" that must not be overwritten since these marks the different rows and the information in the rows. The workbook is meant for medical purposes.

    Yes you are correct. This is exactly what I am asking.

    Chiss

  6. #6
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Updating worksheet and move data to another worksheet

    Hi Chiss,

    I think I have created what you need, the code is accessible by running the macro "Update_Data" or just click the command button on the "Existing Data" tab.

    Note: The "Traceability" and "Updated Data" tabs are cleared every time the code is run.

    I have created backup copies of the worksheets should you need them.

    Let me know if this works for you!

    Owen
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-15-2015
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2010
    Posts
    4

    Re: Updating worksheet and move data to another worksheet

    Hi Owen,

    It looks great and does the job quickly and almost as I would like it too - Thank you :-)

    My only concern is that the "RecordID" will have to be in the same order (for the sheets "Existing data" and "New data") for it to work. But I guess this will be a good starting point for me to explore it further :-)

    Unless you have an idea on how to overcome this obstacle?

    /Christopher

  8. #8
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Updating worksheet and move data to another worksheet

    Hi Chiss,

    There is always a way...

    Sorry, there was a simple fundamental flaw in the code.

    Hopefully (fingers crossed) the attached should work for you this time.

    Again let me know if it works (or doesn't work), I'm sure we can get to the bottom of this!

    Owen
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro in excel to move a row of data from one worksheet to another worksheet
    By wmdowty in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-26-2013, 11:06 AM
  2. Can I script to move data from a worksheet of tables/forms into 1 worksheet with 1 table
    By andybrown65 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 02:35 PM
  3. Replies: 0
    Last Post: 03-03-2012, 03:29 AM
  4. Replies: 1
    Last Post: 02-14-2012, 07:00 AM
  5. Move Data in a Worksheet to Another Worksheet
    By jason_kelly in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-18-2010, 12:03 AM
  6. How to move specific data from one worksheet to another worksheet
    By treeskin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2007, 02:59 AM
  7. How to move specific data from one worksheet to another worksheet
    By treeskin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2007, 08:53 AM

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