vicktor schausberger
Member
Hi, guys, I have an array A1:E12 and I write this code to add all the columns and the results on H, and subtract all the col and the results on K. well I couldn't figure it out if I want to also add for example col A1+B1 results on "H", (I mean start another code) B1-C1 results on "I" etc.
this is the code I want to transform, I mean to see how and what "words" change, with the new request.
thanks
this is the code I want to transform, I mean to see how and what "words" change, with the new request.
Code:
Option Explicit
Sub addingarray()
Dim Rw As Long, Cl As Long
For Rw = 1 To Cells(Rows.Count, "A").End(xlUp).Row
For Cl = 1 To 6
Cells(Rw, "H").Value = Cells(Rw, "H").Value + Cells(Rw, Cl).Value
Cells(Rw, "K").Value = Abs(Cells(Rw, "K").Value - Cells(Rw, Cl).Value)
Next
Next
End Sub