Results 1 to 6 of 6

Thread: IF conditions

  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If Mid(RngFind.Offset(0, -16), 16, 1) = "E" Then
    RngFind.Offset(0, 1).FormulaR1C1 = "=Value(MID(RC[-17],11,5))"
    End If


    Would it be possible to adapt the above to:

    If Mid(RngFind.Offset(0, -16), 16, 1) = "E"

    And:

    The previous 5 characters are numeric

    So

    487500006666323E would return the formula

    But:

    MORTGAGE VAL FEE would not.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try

    If Mid(RngFind.Offset(0, -16), 16, 1) = "E" And IsNumeric(Mid(RngFind.Offset(0, -16), 11, 5)) Then

  3. #3

  4. #4
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Set RngFound = y3.Find(What:=RngFind, LookIn:=xlValues, LookAt:=xlWhole)
    If Not RngFound Is Nothing Then
    RngFind.Offset(0, -6) = RngFound.Offset(0, -7)
    RngFind.Offset(0, -5) = "Purged Found"
    Range(RngFind.Offset(0, -5), RngFind.Offset(0, -18)).Interior.ColorIndex = 36
    End If


    I only want to do this if RngFound.Offset(0, -7) is not identical to RngFind

    I am looking up the invalid reference (RngFind) against a 2 column report that shows the invalid reference and a valid reference. On rare occasions (like today), the valid reference is the same as the invalid one, in which case I do not want to report it as valid. How please?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Add a condition that checks whether RngFind equals RngFound.

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •