Hello,
i am trying to do a simple task with VBA but code is not working. I need to add Column N,Q,T.... In other words every 3 column
i have the following code
The macro runs but it doesn't give me the right answer. for example the answer in column 79 or 'CA' should be following
<tbody>
</tbody>
But macro gives the following answer
<tbody>
</tbody>
which means it adds each row from top to bottom in column 79. I am not sure how to fix it.
Any help is much appreciated.
Thanks
i am trying to do a simple task with VBA but code is not working. I need to add Column N,Q,T.... In other words every 3 column
i have the following code
PHP:
For lrow = 7 To 15
For xcol = 14 To 78 Step 3
'sumx = 0
sumx = sumx + Cells(lrow, xcol).Value
Next xcol
md.Cells(lrow, 79).Value = sumx
Next lrow
The macro runs but it doesn't give me the right answer. for example the answer in column 79 or 'CA' should be following
1 |
5 |
39 |
1 |
1 |
4 |
36 |
0 |
<tbody>
</tbody>
But macro gives the following answer
1 |
6 |
45 |
46 |
47 |
51 |
87 |
87 |
<tbody>
</tbody>
which means it adds each row from top to bottom in column 79. I am not sure how to fix it.
Any help is much appreciated.
Thanks