I am trying to make cells in a row subtract the two cells in the above to rows from each other (A1 - A2 = A3 ) using the below diagram.
THE code is as follows:
Sub Module2()
Range("A3:B3" & lastrow).Formula = "=A1-A2"
End Sub
However I am trying to make the cell appear blank if the value = zero (i know this can be done using conditional formatting but i can’t use this method as it is disrupts the heat map i have created as i have defined a formatting range to the end of the last column in the row and do not want the zeros to disrupt the formatting)
My problem is that i am can’t seem to get the right code in place for the macro so that it automatically subtracts the rows (A1&A2) but leaves the cell blank if it is zero (as i do not want it to affect my conditional formatting IF I extend the formula to the end of the sheet waiting for the fields to be populated above it (the formula) on a monthly basis)
THE code is as follows:
Sub Module2()
Range("A3:B3" & lastrow).Formula = "=A1-A2"
End Sub
However I am trying to make the cell appear blank if the value = zero (i know this can be done using conditional formatting but i can’t use this method as it is disrupts the heat map i have created as i have defined a formatting range to the end of the last column in the row and do not want the zeros to disrupt the formatting)
My problem is that i am can’t seem to get the right code in place for the macro so that it automatically subtracts the rows (A1&A2) but leaves the cell blank if it is zero (as i do not want it to affect my conditional formatting IF I extend the formula to the end of the sheet waiting for the fields to be populated above it (the formula) on a monthly basis)