Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I feel this should be a very easy solution, but I am finding myself struggling.
The idea is to compare variable pdd (time) to the value in column B of a range defined by B70:E73. Sadly, I don't have an HTML generator installed to show you the data.
Within the range:
B70 = 7:00 am (pdd = 7:00 am)
B71 = 7:00 am (pdd = 7:00 am)
B72 = 7:00 am (pdd = 7:00 am)
B73 = 4:00 pm (pdd = 4:00 pm)
CDate(dpgo) = 7:00 am
This code seems to be inappropriately (based on my goal) to be eliminating all including those where pdd matches cdate(dpgo). The only range that should be affected because pdd is greater than CDate(dpgo) would be row 73 4:00 pm > 7:00 am. Rows 70-72 shouldn't be affected.
Code:
For p = 70 To 73
If tpgo = "<" Then
pdd = format(ws_sbase.Cells(p, 2), "h:mm am/pm")
If pdd > CDate(dpgo) Then 'those that start before groom offset time, when the only program, is eligible
ws_sbase.Range("B" & p & ":C" & p).ClearContents
ws_sbase.Range("D" & p) = "X"
ws_sbase.Range("E" & p) = ""
End If
End If
Next p
The idea is to compare variable pdd (time) to the value in column B of a range defined by B70:E73. Sadly, I don't have an HTML generator installed to show you the data.
Within the range:
B70 = 7:00 am (pdd = 7:00 am)
B71 = 7:00 am (pdd = 7:00 am)
B72 = 7:00 am (pdd = 7:00 am)
B73 = 4:00 pm (pdd = 4:00 pm)
CDate(dpgo) = 7:00 am
This code seems to be inappropriately (based on my goal) to be eliminating all including those where pdd matches cdate(dpgo). The only range that should be affected because pdd is greater than CDate(dpgo) would be row 73 4:00 pm > 7:00 am. Rows 70-72 shouldn't be affected.
Last edited: