View Single Post
 
Old 09-09-2011, 07:52 PM
jcg31 jcg31 is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Sep 2011
Posts: 1
jcg31 is on a distinguished road
Default Setting status on a task from excel

I am creating an app in excel and want to establish the status of a task based upon how the status is represented in the cell on the sheet. As an example Cell A17="Not Started" At the moment I am using a select statement
Code:
           Select Case Trim(Worksheets(shtName).Cells(17,1))
           Case Is = "Not Started"
           .Status = 0 'olTaskComplete
           Case Is = "In Progress"
           .Status = 1 ' olTaskInProgress
           Case Is = "Completed"
           .Status = 2
           Case Is = "Waiting on someone else"
           .Status = 3 'olTaskWaiting
           Case Is = "Deferred"
           .Status = 4 'olTaskDeferred
           End Select
but would prefer just to read the status from the cell as in
Code:
 With olTask
.Status = Trim(Worksheets(shtName).Cells(17,1))
but that doesn't work. Is there a property that I can use to assigning the string "Completed" to a task?

Thanks for any help.
Jim
Reply With Quote