+ Reply to Thread
Results 1 to 3 of 3

Add data rows based on unique numbers in kolom

  1. #1
    Registered User
    Join Date
    03-17-2017
    Location
    Amsterdam
    MS-Off Ver
    2007
    Posts
    14

    Smile Add data rows based on unique numbers in kolom

    Hey,

    I got a file with a lot of information (+/- 15.000 rows), this information is added trough a (lets call it temp) file (about 200 rows) which is constantly updated with new rows, information in existing rows and completed rows get deleted.
    Now the big file I got is supposed to keep all the information ever been in the temp file so we can make anylises of it and get important data. (except changes in rows, these contain price changes which can be overwritten)
    The thing I would like to achieve is that the information from the temp file gets automaticly added to the big file.
    For this I created unique numbers in kolom A for every row in both files. (its a calculation between non-changing information in the row which can never be the same outcome for two rows)

    Now my idea is this:

    I have the temp file open
    I Dim kolom A as range
    Then I use, for every value in range ***
    The 2 lines below define the action they need to do, but I can't find anywhere how to do it
    If value in range is existing in kolom a of the big file, copy the entire row with the unique number from the temp file, and paste it over the row with the same unique number in the big file.
    elseIf the value from the range is not found in the big file then add the row from the temp file under the existing rows in the big file.

    I hope you guys can help me out on this

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Add data rows based on unique numbers in kolom

    Hi - from your description, it seems you're simply trying to copy/paste a new row if the value is not found in column A or update the existing row if the value is found. Easiest way would be to use the .Find function in the column A range. If it returns Nothing then add a new record. If something is found it will return the cell range so you then have the row to update.

    Hope that helps. MM
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Add data rows based on unique numbers in kolom

    Hi Warmerfare

    Upload a sample workbook depicting your required result and we'll be glad to write some code for you.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. Insert/Delete rows based on the same numbers of rows with data in other sheet
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2015, 08:28 PM
  2. Fill a kolom with data depending an different interval
    By phanegem in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2014, 06:57 AM
  3. Move data in rows to columns based on unique ID in column A
    By ssdsibes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-04-2013, 07:04 AM
  4. [SOLVED] Delete rows of data based on list of unique numbers with a macro
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2013, 07:40 AM
  5. Extracting rows based on multiple ranges and unique numbers
    By D13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2012, 09:33 AM
  6. Excel 2007 : HELP - Deleting rows based on unique data
    By mikedakota43 in forum Excel General
    Replies: 1
    Last Post: 06-23-2011, 02:10 AM
  7. Combine rows of data into 1 cell based on unique identifier
    By jud_goh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 05:06 PM

Tags for this Thread

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