Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum a salary column using macro
dear all, infact i need very simple coding but i still failed
i have this statement to count the total record to sum lastrow = Range("C" & Rows.Count).End(xlUp).Row now i just couldn't find a way to sum up salary column something like this : i know this is incorrect but i want something like this so can pass the value to variable totalsum totalsum = sum(range("e2:e" & lastrow)) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum a salary column using macro
Hi Tango, try something like totalsum = Application.WorksheetFunction.Sum(Range("e2:e" & lastrow)) Have a look @ the help files for WorksheetFunctio -- Ivan F Moal ----------------------------------------------------------------------- Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195 View this thread: http://www.excelforum.com/showthread.php?threadid=26978 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum a salary column using macro
You almost got it. Just add application. before the sum
lastrow = cells(Rows.Count,3).End(xlUp).Row totalsum =application.sum(range("e2:e" & lastrow)) -- Don Guillett SalesAid Software "tango" wrote in message om... dear all, infact i need very simple coding but i still failed i have this statement to count the total record to sum lastrow = Range("C" & Rows.Count).End(xlUp).Row now i just couldn't find a way to sum up salary column something like this : i know this is incorrect but i want something like this so can pass the value to variable totalsum totalsum = sum(range("e2:e" & lastrow)) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calculate diffence between old salary and new salary | Excel Worksheet Functions | |||
Salary Reciept | New Users to Excel | |||
Salary codes | Excel Discussion (Misc queries) | |||
salary tax calculation f | Excel Discussion (Misc queries) | |||
Salary | Excel Discussion (Misc queries) |