Bonjour,
Un essai ...
Sub OuvrirCalendrierChoisi()
Dim DateDebutChoisie As Long
Dim DateFinChoisie As Long
Dim ColDeb As Range
Dim ColFin As Range
'nettoyer l'endroit où sera copié le calendrier
With Sheets("1")
.Activate
With .Columns("A:AE")
.ClearContents
.ClearComments
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
With .Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
.UnMerge
End With
'définit la valeur cherchée, ici 92020 pour le début et 102020 pour la fin
DateDebutChoisie = .Range("AL5")
DateFinChoisie = .Range("AL6")
End With
'dans l'onglet Calendrier, trouve 92020
With Sheets("Calendrier")
.Activate
Set ColDeb = .Rows(2).Find(what:=DateDebutChoisie, LookIn:=xlValues)
If Not ColDeb Is Nothing Then col = ColDeb.Select
'si 92020 trouvé alors redimensionne et nomme la plage trouvée "DateDeDebut"
Set DateDeDebut = .Cells(3, ColDeb.Column).Resize(100, 7)
Names.Add Name:="DateDeDebut", RefersToR1C1:=DateDeDebut
'dans l'onglet Calendrier, trouve 102020
Set ColFin = .Rows(2).Find(what:=DateFinChoisie, LookIn:=xlValues)
If Not ColFin Is Nothing Then col = ColFin.Select
'si 102020 trouvé alors redimensionne et nomme la plage trouvée "DateDeFin"
Set DateDeFin = .Cells(3, ColFin.Column).Resize(100, 7)
Names.Add Name:="DateDeFin", RefersToR1C1:=DateDeFin
End With
Sheets("1").Activate
'par conséquent copie colle les zones correspondantes
'Début
Range("DateDeDebut").Copy Sheets("1").Range("I1")
'Fin
Range("DateDeFin").Copy Sheets("1").Range("Q1")
Range("AL5").Select
End Sub
ric