Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This assumes a headre row and that the months are listed consecutively
beginning in column A. Sub motst() LRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Row x = Month(Now) If x = 2 Then myVal = Application.WorksheetFunction.Sum(Range("B2:B" & LRow)) MsgBox myVal End If End Sub "Citizen" wrote: I have the months of a year in a row. In each column I have values (e.g. $/Jan, $/Feb, $/March). Now I want to write a formula that gives me the sum of the values for the year to date (ie in March give me the sum of the values for Jan, Feb, & March but no others). I use "MONTH(NOW())" to get the current month. How to I get the sum of the values for this variable number of cells (ie it grows from 1 to 12 cell values depending upon the month of the year it is)? thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Summing an unkown number of columns | Excel Worksheet Functions | |||
Highlight cells with certain number values | Excel Worksheet Functions | |||
Number of cells that have same values | Excel Discussion (Misc queries) | |||
VBA Pivot Tables with unkown # of rows in the data set | Excel Programming | |||
Passing an unkown range to a function | Excel Programming |