LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sum of Variable Cells in a Column

if Range("D10").Value = "" then
mysum = Application.Sum(range("N1:N9"))
elseif Range("D16").Value = "" then
mysum = Application.Sum(range("N11:N15"))
else
mysum = 0
End if

--
Regards,
Tom Ogilvy

"IJQ" wrote in message
...
Hi,

How to sum a variable no of cells in a column using VBA, I want the code

to
sum up the cells on a certain condition of other cells such as IF(D10=""),
then add up all cells between N1 and N9, and so on IF D16="", then add up

all
cells from N11 up to N15.
Can anybody help?
Regards.



 
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
Display cells(text) in one column based on cells which are present inother column [email protected] Excel Discussion (Misc queries) 1 May 12th 08 01:40 PM
variable column Libby Excel Worksheet Functions 1 January 28th 08 06:32 PM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM
Finding cells and summing variable cells Chris M.[_3_] Excel Programming 3 August 21st 03 09:13 PM


All times are GMT +1. The time now is 11:42 PM.

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"