Hi, I wonder whether someone can help me please.
I'm using the code below which performs the following function:
- Compare a column of project end dates (column G on the "In Flight Projects" sheet) with the dates in a row of column headers on the "Flexible Resources List" sheet, and
- Where there is a match, count the number of projects which are being worked within that given month.
Code
'***This section of code adds the 'In Flight Projects' count for each month comparing the date in each column header to the 'End Date' on the "In Flight Projects Page"***
With .Offset(11, 1)
For Each rCell In Range(.Cells(1), Cells(.Cells(1).Row, Columns.Count).End(xlToLeft))
Sheets("In Flight Projects").Activate
Range("G8").Select
Do Until ActiveCell = ""
If ActiveCell.Value >= rCell.Value Then y = y + 1
ActiveCell.Offset(1).Select
Loop
rCell.Offset(1).Value = y
Sheets("Flexible Resources Profile").Activate
y = 0
Next rCell
End With
'***End***
Display More
The problem I have is that I'm trying to add an additional 'If' satement which before this line Do Until ActiveCell="" I want to say if the cell value offset minus 4 to G8 has the value "C&R" then run the rest of the code.
It think I'm right in using this line
but despite inserting this at different points in the code I'm unable to get this to work.
Many thanks and kind regards
I just wondered whether someone could possibly look at this please and let me know where I'm going wrong.