#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default sum

Running below code get formula of =SUM('b9':B26)
Is there anyone tell me how can I get rid of '' from b9 by amend the below
coding?

ActiveCell.FormulaR1C1 = "=SUM(b9:R[-1]C)"


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default sum

ActiveCell.FormulaR1C1 = "=SUM(R9C2:R[-1]C)"

Don't mix R1C1 and A1 style addressing. In this case, because you use
formulaR1C1, use pure R1C1 style.

--
Regards,
Tom Ogilvy


"Anna" wrote:

Running below code get formula of =SUM('b9':B26)
Is there anyone tell me how can I get rid of '' from b9 by amend the below
coding?

ActiveCell.FormulaR1C1 = "=SUM(b9:R[-1]C)"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default sum

It is easy to sum a range of cells by using shortcut button. If the
activecell is a100, I select the shortcut button. The sum Formula would be
a32..a99.
If b32 and a99 are variable not fixed cell, How do I write the formula at vba?



"Anna" wrote:

Running below code get formula of =SUM('b9':B26)
Is there anyone tell me how can I get rid of '' from b9 by amend the below
coding?

ActiveCell.FormulaR1C1 = "=SUM(b9:R[-1]C)"


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 12:28 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"