+ Reply to Thread
Results 1 to 13 of 13

Run formulas with macro but compare values in cell

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Run formulas with macro but compare values in cell

    Hi I have below code which pin out numbers from IBAN in Column P. Its formulas run by macro. It works fine.
    But what i really need is that instead of putting the formula in the cell, is that it compare the value from the formula, with the excisting value , in each cell . And it mark the cells where there are a difference with yellow colour
    I have been thinking how to do this but cant really work it out.
    If some have a better solution its ok but i need a macro for it.

    Please have a look at below code, which change the cell and correct the error, but which i want just to compare the values.

    I have attached a sheet to test with.

    Thanks

    Sincerely
    Abjac

    The code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    See if this is what you are looking for.
    Attached Files Attached Files
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    Hi jessebranum. Yes this is exactly what i need, its a great code. Only thing is that it replace the value in the cells, which are not colored,with the formula. I would prefer the value. Done know if that can be done. But your code do it i think. Please have a look at the value, if is possible to keep it in the other cells.

    Thanks in advance

    Sincerely

    Abjac

  4. #4
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    So you want it to replace the value of the cell that is different, you don't want to see it first but rather just know that is was different? Is that correct?

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    No not really. I would like to not have the formulas, but the value also in the cells, where it don't find any difference.
    As it is now it change the value in these cells to the formula., when I enter the cells.

    But I discovered another more big problem for me. I suddenly was using it with IBAN which have letters in the account number. And here the code stop working.
    I have uploaded a new sheet to look at with other IBANs where in some, there is letters in the account number,

    If you can solve this its more important really.

    Please have a look at the new test sheet below

    Thanks

    Sincerely
    Abjac
    Attached Files Attached Files

  6. #6
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    I modified the macro you used in the workbook to eliminate the formulas and solved the letter issue.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    Hi Jessebranum777. Its nearly there. But please try run the new code in below sheet. It make an weird error in H14 and also it select H15 even if it should select A1. Please try run the code in the sheet I upload. But I think its close to work there. So have a look and try in the sheet. Inputformula14 is your new code to run

    Thanks in advance

    Sincerely

    Abjac
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    Even better here. Try this sheet much more to validate. When there is no IBAN in column P it should give a yellow. But it stop run in column H..
    Please also try this new sheet with more items.

    Thanks in advance

    Sincerely
    Abjac
    Attached Files Attached Files

  9. #9
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    I don't see any spots where there is a blank in column P that doesn't mark the corresponding cell yellow. If you do please let me know which one. I didn't get any errors however I noticed that column H was missing a bank account number so I adjusted the macro to mark it yellow continue if that is the case. Please use the code below as the code you had on the sheets was the old code which will error out on letters.

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    Hi Jessebranum. I think i put both macro in d last testsheet here. I am on d way home. But will have a look when home. Thanks Abjace

  11. #11
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    Sounds good I will wait to hear back from you then.

  12. #12
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Run formulas with macro but compare values in cell

    Hi Jessenranum. I tested the code in a big sheet the last code and it works brilliant for sure. Thanks allot for all your effort. Its a big help for me, so thanks allot.

    Have a nice day

    Sincerely
    Abjac

  13. #13
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Run formulas with macro but compare values in cell

    Awesome. I'm glad I could help. Thanks for marking the thread solved and for the rep.

+ 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] Compare cell values of different Workbooks and prompt message using macro
    By jericlapuz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 03:42 AM
  2. Compare the cell values in two different workbooks and copy values from one to the other
    By BettyBoop64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2012, 04:48 PM
  3. [SOLVED] compare cell value with range of values and match row values with header
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2012, 12:19 AM
  4. Replies: 5
    Last Post: 05-05-2008, 02:22 PM
  5. [SOLVED] compare sheets (values and formulas), alert it like spellcheckers
    By coco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2005, 04:05 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