Bonjour,
J'aimerais changer dynamiquement la plage de source d'un graphique.
A l'enregistreur de macro j'obtient:
ActiveChart.SetSourceData Source:=Sheets("Summary & graph 2").Range( "B35,AN35:CC35,B44,AN44:CC44")
j'aimerai réecrire la même chose en remplaçant "B35" par cells(35,2) idem pour les autres, dans le but de remplacer ces nombres par des variables.
j'ai fais plusieurs tentative des traductions qui n'ont pas marché, exemple:
ActiveChart.SetSourceData Source:=Sheets("Summary & graph 2").Range(Cells(35, 2)),Sheets("Summary & graph 2").Range(Cells(35, 34), Cells(35, 78)),Sheets("Summary & graph 2").Range(Cells(44, 2)),Sheets("Summary & graph 2").Range(Cells(44, 34), Cells(44, 78))
ActiveChart.SetSourceData Source:=Sheets("Summary & graph 2").Range(Cells(35, 2)) & ";" & Sheets("Summary & graph 2").Range(Cells(35, 34), Cells(35, 78)) & ";" & Sheets("Summary & graph 2").Range(Cells(44, 2)) & ";" & Sheets("Summary & graph 2").Range(Cells(44, 34), Cells(44, 78))
Quelq'un aurait-il une solution pour moi?
Merci d'avance.
Partager