Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default VBA Sum Non-Contiguous Columns

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default VBA Sum Non-Contiguous Columns

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

--
Don Guillett
SalesAid Software

"Exceller" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default VBA Sum Non-Contiguous Columns

Thanks, Don. I appreciate your help.
Exceller

"Don Guillett" wrote:

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

--
Don Guillett
SalesAid Software

"Exceller" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Charting with non contiguous columns David Hopper Charts and Charting in Excel 3 April 7th 07 01:00 AM
Copying non-contiguous columns to contiguous columns Bob Excel Programming 1 August 10th 06 03:45 AM
DCOUNT for non-contiguous columns RiotLoadTime Excel Worksheet Functions 4 July 3rd 06 03:12 PM
Hide non-contiguous columns BEEJAY Excel Programming 2 May 23rd 06 01:25 PM
How to Remove Non-Contiguous Columns from Worksheet sjane Excel Programming 3 May 6th 05 06:29 PM


All times are GMT +1. The time now is 09:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"