VBA Sum Non-Contiguous Columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking for VBA code to sum columns P and R in column S (sheet 1).
So, cell P2 and R2 will be summed in S2; P3 and R3 summed in S3, and so on.
Thanks!
Exceller
 
Set frng = Range("s2:s" & Cells(Rows.count, "s").End(xlUp).Row)
With frng
.Formula = "=p2+r2"
'uncomment next line to eliminate the formula
' .Formula = .Value
End With
 
Thanks, Don. I appreciate your help.
Exceller

Don Guillett said:
Set frng = Range("s2:s" & Cells(Rows.count, "s").End(xlUp).Row)
With frng
.Formula = "=p2+r2"
'uncomment next line to eliminate the formula
' .Formula = .Value
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top