summing of column

  • Thread starter manish chulawala
  • Start date
M

manish chulawala

i want to sum up one of the task column say total hours what is the option to
dp the same.
 
S

Sue Mosher [MVP-Outlook]

You'd need to iterate all the items in the folder, as in this Outlook VBA or custom form VBScript sample, which displays the total to the user in a message box:

Sub SumTasks()
Dim ns 'As Outlook.NameSpace
Dim fld 'As Outlook.MAPIFolder
Dim tasks 'As Outlook.Items
Dim task 'As Outlook.taskItem
Dim taskTIme 'As Long

Set ns = Application.Session
Set fld = ns.GetDefaultFolder(olFolderTasks)
Set tasks = fld.Items
On Error Resume Next
For Each task In tasks
taskTIme = taskTIme + task.ActualWork ' in minutes
Next
MsgBox "You have spent " & taskTIme & " minutes on tasks.", , "Task Minutes"

Set task = Nothing
Set tasks = Nothing
Set fld = Nothing
Set ns = Nothing
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

manish chulawala

thank you very much

but i do not know how to put this in outlook as i am not vba expert

regards
 
M

manish chulawala

i have done it and it works great.

but what i wanted is that the sum should show directly on the screen in the
last cell. like total of all cell.

basically i want total of all cell in the last line
 
S

Sue Mosher [MVP-Outlook]

Outlook cannot do that. It doesn't work like a spreadsheet.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top