P
petitboeuf
Hiya Experts
I am trying to do a simple macro that will colour my tasks based on
completed and date
Code
-------------------
Sub HighlightTasks(
Dim t As Task, ts As Task
Dim dEnd As Dat
iDate = InputBox("Please set the date", "Date Input", "dd/mm/yyyy"
If iDate = "" Then Exit Su
Set ts = ActiveProject.Task
For Each t In t
progress = t.PercentComplet
dEnd = t.Finis
If progress > 1 The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjGreen, Size:=
End I
If progress = 100 The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjBlue, Size:=
End I
If dEnd < iDate The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjRed, Size:=
End I
If dEnd > iDate The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjBlack, Size:=
End I
Next
End Su
-------------------
My issues are that when I run the code I get iDate to read "18/12/2008
for example and t.Finish reads 21/01/2009 09:46:00 for example..
So as they don't have the same format I cannot match them..
*Edit* PercentComplete does not seem to work either... it change
colours of random tasks regardless of %..
I know the code is simplistic and hopefully you guys can help out
Many thanks in advance
I am trying to do a simple macro that will colour my tasks based on
completed and date
Code
-------------------
Sub HighlightTasks(
Dim t As Task, ts As Task
Dim dEnd As Dat
iDate = InputBox("Please set the date", "Date Input", "dd/mm/yyyy"
If iDate = "" Then Exit Su
Set ts = ActiveProject.Task
For Each t In t
progress = t.PercentComplet
dEnd = t.Finis
If progress > 1 The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjGreen, Size:=
End I
If progress = 100 The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjBlue, Size:=
End I
If dEnd < iDate The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjRed, Size:=
End I
If dEnd > iDate The
SelectRow Row:=t.ID, RowRelative:=Fals
Font Color:=pjBlack, Size:=
End I
Next
End Su
-------------------
My issues are that when I run the code I get iDate to read "18/12/2008
for example and t.Finish reads 21/01/2009 09:46:00 for example..
So as they don't have the same format I cannot match them..
*Edit* PercentComplete does not seem to work either... it change
colours of random tasks regardless of %..
I know the code is simplistic and hopefully you guys can help out
Many thanks in advance