Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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
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
calculate diffence between old salary and new salary Felicia Pickett Excel Worksheet Functions 4 April 6th 10 04:32 PM
Salary Reciept hikmat New Users to Excel 3 March 30th 10 01:51 PM
Salary codes Warrickrick Excel Discussion (Misc queries) 1 January 27th 10 04:12 PM
salary tax calculation f lebasse[_2_] Excel Discussion (Misc queries) 2 August 21st 08 02:59 PM
Salary DP7 Excel Discussion (Misc queries) 2 February 23rd 07 09:09 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"