Hi
I have a problem that i hope someone can help me with.
I got a excelfile containing 50 sheets , named "15HP", "03AE" etc. , and one sheet that contains charts,
The sheets names is the same as the names of the charts.
So, what i want to do is to get the charts with the same name as my worksheets, copyed to the worksheet
Instead of coding with hard values, like my code below, i want to make my macro more dynamic.
With dynamic, i mean that the macro should loop thru each sheet and copy the right chart.
Regards from Sweden
Johan
Sub test()
'
Sheets("charts").Select
ActiveSheet.ChartObjects("15HP").Activate
Selection.Copy
Sheets("15HP").Select
Range("H10:K33").Select
ActiveSheet.Paste
ActiveSheet.Pictures.Paste.Select
Range("A1").Select
Sheets("charts").Select
ActiveSheet.ChartObjects("03AE").Activate
Selection.Copy
Sheets("03AE").Select
Range("H10:K33").Select
ActiveSheet.Paste
ActiveSheet.Pictures.Paste.Select
Range("A1").Select
and so on....
.....
End Sub
I have a problem that i hope someone can help me with.
I got a excelfile containing 50 sheets , named "15HP", "03AE" etc. , and one sheet that contains charts,
The sheets names is the same as the names of the charts.
So, what i want to do is to get the charts with the same name as my worksheets, copyed to the worksheet
Instead of coding with hard values, like my code below, i want to make my macro more dynamic.
With dynamic, i mean that the macro should loop thru each sheet and copy the right chart.
Regards from Sweden
Johan
Sub test()
'
Sheets("charts").Select
ActiveSheet.ChartObjects("15HP").Activate
Selection.Copy
Sheets("15HP").Select
Range("H10:K33").Select
ActiveSheet.Paste
ActiveSheet.Pictures.Paste.Select
Range("A1").Select
Sheets("charts").Select
ActiveSheet.ChartObjects("03AE").Activate
Selection.Copy
Sheets("03AE").Select
Range("H10:K33").Select
ActiveSheet.Paste
ActiveSheet.Pictures.Paste.Select
Range("A1").Select
and so on....
.....
End Sub