#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How To Sum

LastCol = Cells(2, Columns.Count).End(xlToLeft).Column
Cells(2, LastCol + 1).FormulaR1C1 = "=SUM(R2C1:R2C" & LastCol & ")"


(and I remembered to offset the cell this time <g)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"hon123456" wrote in message
ps.com...
Thanks for you all,

My another question is how can I sum the result
horizontally?

Thanks



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



All times are GMT +1. The time now is 02:29 AM.

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

About Us

"It's about Microsoft Excel"