Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Absolute reference problem - Excel 2007

Hi,
I have to obtain the sum of a column and then have to have that total
appear in another sheet of the workbook every month in order that I
can keep a track of each month's expenses - so far that is no problem.
However, the length of the column varies each month so I am prevented
from using the absolute reference function - can anyone please suggest
how I may overcome this? I am using Excel 2007
--
Cheers

Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Absolute reference problem - Excel 2007

The sum function ignores empty cells. You can have the end row be larger
than the maximum for any month. Make it the last row of the worksheet which
is 65536 for Excel 2003. Excel 2007 can be larger. Make it sufficiently
large enough so you won't have problems in the future.


=sum(A1:A65536)

"Peter Thomas" wrote:

Hi,
I have to obtain the sum of a column and then have to have that total
appear in another sheet of the workbook every month in order that I
can keep a track of each month's expenses - so far that is no problem.
However, the length of the column varies each month so I am prevented
from using the absolute reference function - can anyone please suggest
how I may overcome this? I am using Excel 2007
--
Cheers

Peter

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Absolute reference problem - Excel 2007

one way, assuming the data starts in a2 on sheet1

Sub test()
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Worksheets("sheet1")
lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row

ws.Range("A" & lastrow + 1).Formula = "=sum(A2:A" & lastrow & ")"

End Sub

--


Gary


"Peter Thomas" wrote in message
...
Hi,
I have to obtain the sum of a column and then have to have that total
appear in another sheet of the workbook every month in order that I
can keep a track of each month's expenses - so far that is no problem.
However, the length of the column varies each month so I am prevented
from using the absolute reference function - can anyone please suggest
how I may overcome this? I am using Excel 2007
--
Cheers

Peter



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Absolute reference problem - Excel 2007

If you don't put any numbers below the data or above the data, you could just
use:

=sum(sheet1!a:a)



Peter Thomas wrote:

Hi,
I have to obtain the sum of a column and then have to have that total
appear in another sheet of the workbook every month in order that I
can keep a track of each month's expenses - so far that is no problem.
However, the length of the column varies each month so I am prevented
from using the absolute reference function - can anyone please suggest
how I may overcome this? I am using Excel 2007
--
Cheers

Peter


--

Dave Peterson
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
How to make an absolute reference to an excel 2007 table column Ollie4 Excel Discussion (Misc queries) 1 February 6th 08 07:13 PM
Absolute Reference Problem... Nad Excel Discussion (Misc queries) 5 May 21st 07 06:37 PM
Problem with Absolute reference WakY Excel Discussion (Misc queries) 3 March 28th 07 08:50 PM
Excel too helpful! (problem with absolute reference) PK Excel Worksheet Functions 2 January 25th 06 02:51 PM
Macro problem. Need a vague not absolute reference Jeff Whitbey Excel Programming 4 July 20th 04 01:09 PM


All times are GMT +1. The time now is 10: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"