Good Morning,
Please see the photo for context of my problem, I have also tried to start the VBA code - any help would be much appreciated! My truncated data set - There is an unknown number of applications and projects.
I am trying to work out, when there might be a potential conflict in projects deploying. The criteria I'm currently working on is 28 days either side (Cell K2), this may be changed to 14 or 7 days.
My Current macro for recording 'clashes' is as follows:
`Dim i As Integer
i = 2
Do While i < ActiveSheet.UsedRange.Rows.Count + 1
Range("B1").Offset(i - 1, 0).Copy
Range("H2").Select
ActiveSheet.Paste
i = i + 1
Loop
Application.ScreenUpdating = True
MsgBox i
End Sub'
I want to another macro to run within this one that where the Application is the same as the one above and there is a 'clash' in column D (this is just an =IF(AND... formula) the contents gets put in the format in this image. This is for the first set of clashes only.
I have started to write some code, based on a previous VBA but have got stuck, any help is much appreciated.
`Sub clashcompile()
Dim lastrow As Long
Dim lastcol As Long
Dim i As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = lastrow - 1 To 2 Step -1
If .Cells(i + 1, "A").Value = .Cells(i, "A").Value And _
.Cells(i + 1, "B").Value > .Cells(3, "H").Value And _
.Cells(i + 1, "B").Value < .Cells(4, "H").Value And _
.Cells(i + 1, "D").Value = .Cells(2, "L").Value Then'
I am stuck after this..
Please ask if any clarification is needed.
Thanks in advance.