I'm trying to extract a date from a spreadsheet that falls between 01/07/2019 and 31/07/2019 and save that in the variable chantalJulyTotalDemanded
.
Dim julyStart As Date
Dim julyFinish As Date
julyStart = CDate("01/07/2019")
julyFinish = CDate("31/07/2019")
If CDate(dataSheet.Cells(x, 12)) >= CDate(julyStart) And _
CDate(dataSheet.Cells(x, 12)) <= CDate(JulyFinish) Then
chantalJulyTotalDemanded = chantalJulyTotalDemanded + dataSheet.Cells(x, 10)
The above also grabs information from dates in August.
The date from the spreadsheet is in the format 1/07/2019.