Forum Discussion

hrh_dash's avatar
hrh_dash
Iron Contributor
Jul 27, 2022
Solved

Set VBA Conditional Format highlight cell not equals 0 and amend subtraction to formula

How do i amend the Macro to  1. set VBA Conditional Format highlight cell when cell is not equals 0 and 2. amend dynamic subtraction to formula instead   Below is the code:   Sub checkcal() D...
  • HansVogelaar's avatar
    Jul 27, 2022

    hrh_dash 

    1. About conditional formatting: the first one looks OK, but in the second one you should change xlExpression to xlCellValue (as in the first one)

     

    2. For the formulas:

     

    ws.Range("G" & check + 3).Offset(0, 1).Formula = "=B" & receiptsLastrow & "-" & contractbid.Offset(0, 1).Address(False, False)

     

    and

     

    ws.Range("G" & check + 4).Offset(0, 1).Formula = "=C" & paymentsLastrow & "-" & vendortotal.Offset(0, 3).Address(False, False)

Resources