PC Review


Reply
Thread Tools Rate Thread

Absolute reference problem - Excel 2007

 
 
Peter Thomas
Guest
Posts: n/a
 
      4th Jul 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
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      4th Jul 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      4th Jul 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
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      4th Jul 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Absolute reference in excel tables ANIL ERDINC TUFEKCI Microsoft Excel Misc 10 16th Jun 2009 03:55 PM
Excel 2007 adds a $ sign (absolute reference) when copy/pasting IslandFitz Microsoft Excel Crashes 1 22nd Mar 2009 05:09 AM
How to make an absolute reference to an excel 2007 table column Ollie4 Microsoft Excel Misc 1 6th Feb 2008 07:13 PM
Excel too helpful! (problem with absolute reference) =?Utf-8?B?UEs=?= Microsoft Excel Worksheet Functions 2 25th Jan 2006 02:51 PM
Excel - Absolute Reference Tracey Microsoft Excel Misc 3 22nd Mar 2004 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:24 PM.