Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default sum a range from a starting point that varies

Chi,
hopefully someone can help with this;

I have a named cell (First_Cell) which changes each month ie A1,B1,C1. I
have a formula that sums First_Cell:Z1 I am trying to write a macro that will
take the column reference (A,B,C) that First_Cell is in, go down 1 row and
sum from that column to the end of the range (if First_Cell is in cell C1, I
need the macro to sum from C2:Z2).
any assistance provided would be gratefully accepted.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sum a range from a starting point that varies

Here is one way...

=SUM(OFFSET(INDIRECT(First_Cell&":Z1"),1,0))

Rick


"sevi61" wrote in message
...
Chi,
hopefully someone can help with this;

I have a named cell (First_Cell) which changes each month ie A1,B1,C1. I
have a formula that sums First_Cell:Z1 I am trying to write a macro that
will
take the column reference (A,B,C) that First_Cell is in, go down 1 row and
sum from that column to the end of the range (if First_Cell is in cell C1,
I
need the macro to sum from C2:Z2).
any assistance provided would be gratefully accepted.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default sum a range from a starting point that varies

hi
if First_Cell changes each month and your formula is based on that then you
really don't need the column reference. First_Cell is both column and row
reference.
Sub fcell()
Dim v As Range
Set v = Range("First_Cell:Z1")
MsgBox WorksheetFunction.Sum(v)
End Sub

regards
FSt1

"sevi61" wrote:

Chi,
hopefully someone can help with this;

I have a named cell (First_Cell) which changes each month ie A1,B1,C1. I
have a formula that sums First_Cell:Z1 I am trying to write a macro that will
take the column reference (A,B,C) that First_Cell is in, go down 1 row and
sum from that column to the end of the range (if First_Cell is in cell C1, I
need the macro to sum from C2:Z2).
any assistance provided would be gratefully accepted.

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
Sum of a range that varies Sebastien Excel Discussion (Misc queries) 1 February 19th 08 04:19 PM
Go back to starting point PeterW[_13_] Excel Programming 2 August 16th 06 01:57 PM
bar chart starting point lnoles Charts and Charting in Excel 1 October 14th 05 02:16 PM
Starting Point of macro Turin Excel Programming 1 July 7th 05 12:51 PM
Bar charts with a differing starting point Teng Charts and Charting in Excel 2 April 23rd 05 03:19 AM


All times are GMT +1. The time now is 08:09 AM.

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"