Bonjour à tous,
Je sollicite aujourd'hui votre aide car je suis bloquée sur un code me permettant de générer un graphe en automatique. En effet, l'erreur 91 "variable objet ou variable de bloc with non définie" ne fait qu’apparaître à l'écran. J'ai tenté plein de manips mais rien n'y fait !
J'espère que vous pourrez m'aider, merci beaucoup par avance !
Mon code est le suivant :
Private Sub CommandButton21_Click()
Dim ShTemp As Worksheet, ShGraphe As Worksheet
Dim fin_A As range, fin_B As range
Dim select_A As range, select_B As range
Windows("Outil_V1.xlsm").Activate
Workbooks("Outil_V1.xlsm").Activate
Set ShTemp = Workbooks("Outil_V1.xlsm").Sheets("dataTemp")
Set ShGraphe = Workbooks("Outil_V1.xlsm").Sheets("GRAPHE")
(l'erreur se localise ici)
fin_A = range("A65536").End(xlUp).Row
select_A = range("A2" & ":" & "A" & fin_A).Select
fin_B = range("B" & Rows.Count).End(xlUp).Row
select_B = range("B2" & ":" & "B" & fin_B).Select
ShTemp.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "=dataTemp!select_B"
ActiveChart.SeriesCollection(1).XValues = "=dataTemp!select_A"
End Sub