Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Summing until empty cell


Hey,

I need a statement for a macro that will sum all the numbers in a range
say d7:d20 and stop when it hits the empty cell below. as I have a gap
and then some more numbers which I don't want included. I also don't
know what the range will be from month to month i.e. next month it
could be d7:d5 etc..

I'm thinking I could put the sum formula at the top and then say do
until active cell = "" but i'm really not sure..

cheers for any help

Hayley


--
Hru48
------------------------------------------------------------------------
Hru48's Profile: http://www.excelforum.com/member.php...o&userid=24895
View this thread: http://www.excelforum.com/showthread...hreadid=542072

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Summing until empty cell


iLastRow = Range("D7").End(xlDown)
myVar = Application.SUM(Range("D7:D" & iLastRow))


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Hru48" wrote in
message ...

Hey,

I need a statement for a macro that will sum all the numbers in a range
say d7:d20 and stop when it hits the empty cell below. as I have a gap
and then some more numbers which I don't want included. I also don't
know what the range will be from month to month i.e. next month it
could be d7:d5 etc..

I'm thinking I could put the sum formula at the top and then say do
until active cell = "" but i'm really not sure..

cheers for any help

Hayley


--
Hru48
------------------------------------------------------------------------
Hru48's Profile:

http://www.excelforum.com/member.php...o&userid=24895
View this thread: http://www.excelforum.com/showthread...hreadid=542072



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
Summing until empty cell Hru48[_18_] Excel Programming 1 May 15th 06 03:21 PM
Leaving an empty cell empty GRL Excel Discussion (Misc queries) 4 April 22nd 06 05:47 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
Empty cell and a the empty String JE McGimpsey Excel Programming 0 September 13th 04 04:12 PM


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