Sorry, I forgot the code. This is what I have now, and it gets the dates (and highlights everything from the two week start date going forward). I am not sure how to incorporate the two week end date. Your help would be greatly appreciated!
Sub HighlightTwoWks()
' Highlight due in next two weeks
Dim T As Task
' Dim SubProjId As Long - subproject removal testing 3/20/17 rlh
Dim TskSub As Task
' Get todays date
' Calculate date paramaters
Dim Today
Today = Date
' Two Weeks
Dim TwoWeeksB As Date
Dim TwoWeeksE As Date
' 2 Weeks
' Tomorrow through Today plus 14
TwoWeeksB = DateAdd("D", 1, Today)
TwoWeeksE = DateAdd("D", 14, Today)
' MsgBox ("Two Weeks Start Date: " & (TwoWeeksB))
' MsgBox ("Two Weeks End Date: " & (TwoWeeksE))
MsgBox ("Two Week Range : " & (TwoWeeksB) & ": - " & (TwoWeeksE))
' Show all Sub-tasks
SelectSheet
OutlineShowAllTasks
For Each T In ActiveProject.Tasks
If Not T Is Nothing Then
If T.Subproject <> "" Then
SubProjId = T.ID
ElseIf Not T.Summary Then
SelectRow Row:=SubProjId + T.ID, rowrelative:=False
Complete = Names & T.PercentComplete
' MsgBox Complete
Names = Names & T.Finish
' test if task is 100% complete first and if so skip to next task on gant chart
If T.PercentComplete <> 100 Then
' If TwoWeeksB < T.Finish > TwoWeeksE Then
If T.Finish > TwoWeeksB Then
If T.Finish > TwoWeeksE Then
' If T.Finish < TwoWeeksB And T.Finish > TwoWeeksE Then
Font32Ex CellColor:=49407
' Font32Ex Color:=2366701
Else: Continue = True
End If
End If
Names = ""
End If
End If
End If
Next T
EditGoTo ID:=1
' message to user that highlighting is done
MsgBox ("Agent is complete")
End Sub