summing of column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to sum up one of the task column say total hours what is the option to
dp the same.
 
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
 
thank you very much

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

regards
 
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
 
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
 
Back
Top