I have a macro that takes a range of cells, copies them as an image, and places them in a separate sheet. I would like to take the image, resize it, and place the correctly sized image into a different sheet.
Sub heatmapToJPEG()
Range("G1:V33").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'places image of heat map into Setup tab
Sheets("Setup").Select
Range("M1").Select
ActiveSheet.Paste
End Sub
I would like to re-size the image one it is in the Setup tab, but when excel places it there, it gives it the default name of Picture 1, Picture 2, Picture 3, or whatever iteration I am on before closing and reopening the workbook.
Is there a way to assign a permanent variable name to the image found in the Setup tab? If so, my thinking was to assign it to the variable name, and pass it off to another sub for resizing and placement. I am sure there are better ways, but am hitting this roadblock.