Hi,
I am copying charts from one excel workbook (model1), and pasting them in a second excel workbook (TempFile) as a picture. There are roughly 60 of these images. I would like to rename these images. The image names keep changing, which leads to problems for the next steps.
Does anyone know how I can simply, run a loop that would just rename all the pictures in the workbook according to a count.
Example, the first picture on sheet1 be called "Picture1", next picture be called "Picture2". Each picture through out the workbook subsequently follows that order.
Thank you in advance.
I have this which I found online, but not sure how to add a count or rename to this.
Sub LoopThroughCharts()
Dim sht As Worksheet
Dim CurrentSheet As Worksheet
Dim cht As ChartObject
Application.ScreenUpdating = False
Application.EnableEvents = False
Set CurrentSheet = ActiveSheet
For Each sht In ActiveWorkbook.Worksheets
For Each cht In sht.ChartObjects
cht.Activate
'Do something with the chart...
Next cht
Next sht
CurrentSheet.Activate
Application.EnableEvents = True
End Sub
I am copying charts from one excel workbook (model1), and pasting them in a second excel workbook (TempFile) as a picture. There are roughly 60 of these images. I would like to rename these images. The image names keep changing, which leads to problems for the next steps.
Does anyone know how I can simply, run a loop that would just rename all the pictures in the workbook according to a count.
Example, the first picture on sheet1 be called "Picture1", next picture be called "Picture2". Each picture through out the workbook subsequently follows that order.
Thank you in advance.
I have this which I found online, but not sure how to add a count or rename to this.
Sub LoopThroughCharts()
Dim sht As Worksheet
Dim CurrentSheet As Worksheet
Dim cht As ChartObject
Application.ScreenUpdating = False
Application.EnableEvents = False
Set CurrentSheet = ActiveSheet
For Each sht In ActiveWorkbook.Worksheets
For Each cht In sht.ChartObjects
cht.Activate
'Do something with the chart...
Next cht
Next sht
CurrentSheet.Activate
Application.EnableEvents = True
End Sub