Sub TransformeDate()
Dim Derlig&
With sh_res_fcst
Derlig = .Range("A" & Rows.Count).End(xlUp).Row
'<== a adapter
.Range("B2:B" & Derlig).TextToColumns Destination:=.Range("B2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 4), TrailingMinusNumbers:=True
End With
End Sub
Sub TestDate() 'Public Sub CheckIsPastOrFuture()
Application.ScreenUpdating = False
Dim Derlig&, i&
TransformeDate
With sh_Data
Derlig = .Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To Derlig
'compare date entre onglet sh_res_fcst et sh_data
'dans feuille data mettre Past si date sh_data est < à sh_res_fcst
If .Range("B" & i) < sh_res_fcst.Range("B" & i) Then '<== a adapter
.Range("F" & i).Value = "Past" '<== a adapter
Else
.Range("F" & i).Value = "Future" '<== a adapter
End If
Next i
End With
End Sub