Results 1 to 13 of 13

Run formulas with macro but compare values in cell

Threaded View

  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.

    Sub inputformula()
    Sheets(1).Activate
        Range("F2").Select
        ActiveCell.FormulaR1C1 = "=TEXT(MID(RC[10],5,4),""00000"")"
        Range("F2").Select
        Selection.AutoFill Destination:=Range("F2:F23"), Type:=xlFillDefault
        Range("F2:F23").Select
        Range("G2").Select
        ActiveCell.FormulaR1C1 = "=TEXT(MID(RC[9],9,4),""00000000"")"
        Range("G2").Select
        Selection.AutoFill Destination:=Range("G2:G23"), Type:=xlFillDefault
        Range("G2:G23").Select
        Range("H2").Select
        ActiveCell.FormulaR1C1 = "=TEXT(RIGHT(RC[8],10),""0000000000"")"
        Range("H2").Select
        Selection.AutoFill Destination:=Range("H2:H23"), Type:=xlFillDefault
        Range("H2:H23").Select
        Range("I2").Select
        ActiveCell.FormulaR1C1 = "=TEXT(MID(RC[7],13,2),""00"")"
        Range("I2").Select
        Selection.AutoFill Destination:=Range("I2:I23"), Type:=xlFillDefault
        Range("I2:I23").Select
        Range("A1").Select
    End Sub
    Attached Files Attached Files

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