A
Adam4321
Hi,
I'm trying to write a simple macro to go through a task list and change the
font of any cells that meet a certain criteria.
The code works in that it goes through all the tasks and checks if it fits
the criteria. But when I tell it to change the font it only does it on the
activecell. I don't know how to tell it to change the font on the cell being
tested or how to change the activecell in line with the condition checker,
I'm sure it's pretty simple but I'm struggling... help appreciated:
Sub Font_Change()
Dim AllTasks As Tasks
Dim Tsk As Task
Set AllTasks = ActiveProject.Tasks
For Each Tsk In AllTasks
If Not Tsk Is Nothing Then
If Not Tsk.Summary Then
If Tsk.PercentWorkComplete = 100 Then
'need to move the active cell to the current Tsk to change the font on the
correct cell!!
Font Color:=9
End If
End If
End If
Next Tsk
End Sub
I'm trying to write a simple macro to go through a task list and change the
font of any cells that meet a certain criteria.
The code works in that it goes through all the tasks and checks if it fits
the criteria. But when I tell it to change the font it only does it on the
activecell. I don't know how to tell it to change the font on the cell being
tested or how to change the activecell in line with the condition checker,
I'm sure it's pretty simple but I'm struggling... help appreciated:
Sub Font_Change()
Dim AllTasks As Tasks
Dim Tsk As Task
Set AllTasks = ActiveProject.Tasks
For Each Tsk In AllTasks
If Not Tsk Is Nothing Then
If Not Tsk.Summary Then
If Tsk.PercentWorkComplete = 100 Then
'need to move the active cell to the current Tsk to change the font on the
correct cell!!
Font Color:=9
End If
End If
End If
Next Tsk
End Sub