Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display cells(text) in one column based on cells which are present inother column | Excel Discussion (Misc queries) | |||
variable column | Excel Worksheet Functions | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Finding cells and summing variable cells | Excel Programming |