+ Reply to Thread
Results 1 to 12 of 12

Return values only if they have changed

  1. #1
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Question Return values only if they have changed

    I have a COLUMN of prices in COLUMN C (C2:C11,C13:C22,...), the prices may be static or may change. I am wanting to return only the value of the original price (C2,C13...) into COLUMN A (A2,A13...), no problem there. But in the subsequent cells in COLUMN A (A3:A11,A14:A22...), I only want to return a value the next ROW down if it differs from the previous ROW and not have any gaps in ROWS in COLUMN A. I have attached a sheet showing the output that I am trying to achieve in COLUMN A. Any ideas?

    example4.xlsx

    Thanks

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Re: Return values only if they have changed

    That worked perfectly, unfortunately I have to share this sheet out and the folks that use are less than technically adept. Anything possible without VBA?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    I'm inept with formulas. You could put it in a double-click event for your sheet:EC3.xlsm

  5. #5
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Re: Return values only if they have changed

    Ha, I'm inept with code!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    Thanks for the rep!

  7. #7
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Re: Return values only if they have changed

    If you don't mind take a look at this, I got everything wired and working but for some reason the code is hanging up on some unrelated content in ROW C, specifically C21:C23, C39:C41, etc (all highlighted yellow). It's simply text but anytime the macro runs and data exists in those cell groups it takes at least 10x as long to run then spits out the '400' error. When I remove the data from those specific groups the macro runs in a snap and no errors. I have no clue why this is affecting the code.

    I put a button on the sheet to run the macro also, it will propagate data to COLUMN H. example4a.xlsm

    thanks

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    Looks like it was overflow:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Re: Return values only if they have changed

    Awesome, now I can work on something else.

    So I don't pound my head against the desk for the rest of the night, what would be your suggestion to populate the dates from COLUMN R into COLUMN F tied to the corresponding price from COLUMN S that is put into COLUMN H. Just as with the prices the date would be populated if there is a price change in COLUMN H and blank if there is no change.

    See attached and I highlighted the matches.

    Last question, I promise.

    example4b.xlsm

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    Probably:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-11-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    26

    Re: Return values only if they have changed

    Good to go, thanks for all the help. It works!

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Return values only if they have changed

    You're welcome!

+ 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] Inserting row : not all values are changed one stay the same??
    By polooop in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-20-2014, 05:50 AM
  2. Replies: 3
    Last Post: 12-13-2013, 06:23 AM
  3. VBA to update values when a different tab is changed
    By devilsolsi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2013, 10:33 AM
  4. Match Columns in 2 Worksheets, return only changed values of other columns
    By cheynooki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2011, 01:19 PM
  5. search for changed values
    By phytos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2005, 07:15 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