+ Reply to Thread
Results 1 to 10 of 10

For a list of entries, overwrite in another tab if entry exists, copy/paste at end if not

  1. #1
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    For a list of entries, overwrite in another tab if entry exists, copy/paste at end if not

    Hi, all,
    I've been searching around for a post on how to do this, but I'm awful at VBA and a lot of what I see is Greek to me. What the other posters are asking for, however, isn't exactly what I want to do and I don't know how to modify their code to make it work. Any help would be greatly appreciated.
    What I need to do:
    I have two tabs (I actually have three copy/pastes to do, but I want to at least try my hand with the others after I get some guidance here): MTD Data and Historical Financial Data. Column D lists our customer order numbers, or COEs, which are unique values. When the macro runs, it should check each COE in MTD Data to see if it appears in Historical Financial Data. If it does, it needs to copy from A:AE (very important that it not copy the whole row) and paste as values over the info for that COE in Historical Financial Data. If the COE does not exist, it needs to copy from A:AE and paste as values at the end of Historical Financial Data.
    For example, if MTD Data has
    COE Revenue
    1 $100
    3 $300

    and Historical Financial Data has
    COE Revenue
    1 $50
    2 $200

    I need Historical Financial Data to be updated to show
    COE Revenue
    1 $100
    2 $200
    3 $300

    Thanks in advance for any help. I may not be able to get back to you this afternoon, but I will try to this evening or tomorrow.
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Try this. I was a little confused as to what happened to the 50 on your historical data, but I assumed you just forgot to include it on your "after the macro is run" example in your post.

    Please Login or Register  to view this content.
    Last edited by walruseggman; 12-15-2014 at 03:18 PM.

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    The $50 was supposed to be overwritten with the new data for that COE, which it appears your code does. Thanks! I'm going to try to take care of the other two tonight or tomorrow. I appreciate the help!

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Ah, gotcha, I didn't understand your example was two columns.

    Good luck with the other two, let me know if you need help.

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    I tried basically replicating your code, creating ws3 and ws4 and updating the ranges for my data on the next one, but I ran into a problem:
    The next two copies come from the same tab. From the Gantt Chart tab, I need it to start at row 21 and match column A (the COEs again) to column A (starting in row 2) of the Historical Gantt tab. If the COE exists, I need it to overwrite from column A:AW; if not, I need it to paste that range as values at the end of the list. Then, A1 of the MTD Data tab has a date manually entered into it. I need AH4:BI4 on the Gantt Chart tab to copy and paste as values into the appropriate month (overwriting if necessary) of the Historical Bay tab from columns B:AC. The months in A on the Historical Bay tab are not text, but the last day of their respective months.
    Thank you very much for your help!
    (P.S. I tried uploading a dummy workbook, but the company I work for blocks it.) Please let me know if you need more explanation and thanks again.
    Last edited by darkyam; 12-15-2014 at 05:31 PM.

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Any chance you could upload a dummy workbook outside of work that has examples of the data in the tabs you just mentioned? I think what you're asking is fairly straight forward, but I'm having a hard time picturing the formatting based on your descriptions.

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    I can try to do that later tonight. Thanks!

  8. #8
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Here it is. Thanks for your help. It is very much appreciated. Please pardon the crude formulas and lack of formatting.
    Attached Files Attached Files

  9. #9
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Bump. Thanks in advance to anyone who helps!

  10. #10
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: For a list of entries, overwrite in another tab if entry exists, copy/paste at end if

    Bump. Thanks!

+ 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. Copy and Paste from an AutoFilter but Insert rows not Overwrite
    By Simon.Ward in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2013, 12:43 PM
  2. [SOLVED] Overwrite row (using copy and paste) based on cell value in a column
    By FunctionalHippie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 01:26 PM
  3. Overwrite row (using copy and paste) based on cell value in a column
    By FunctionalHippie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2013, 01:16 PM
  4. Copy and Paste Overwrite Extension
    By ljrezn in forum Excel General
    Replies: 0
    Last Post: 06-24-2011, 01:13 PM
  5. Macro to copy sheet from closed work book and overwrite if sheet already exists
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-23-2009, 06:36 PM

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