none
Subtract a previous cell from the current cell RRS feed

  • Question

  • Hi 

    I am trying to subtract a previous cell from the next cell in column a and return its result in column b 

    the above needs to run down for different values to row number 77

    Thursday, February 7, 2019 12:38 PM

All replies

  • Does this do what you want?

    Sub SubtractValues()
        With Range("B2:B77")
            .Formula = "=A2-A1"
            ' If you want values instead of formulas:
            .Value = .Value
        End With
    End Sub


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Thursday, February 7, 2019 3:20 PM