Hi,
I am trying to copy a data from a range and paste it as "linked image" in another range. Excel seems to define a new name for the image as it gets pasted each time. How do I define a name for this image?
What I want to do is to resize the pasted image to fit in a defined range. Please help me with the code to resize the image also. I have pasted what I have written so far.
I am trying to copy a data from a range and paste it as "linked image" in another range. Excel seems to define a new name for the image as it gets pasted each time. How do I define a name for this image?
What I want to do is to resize the pasted image to fit in a defined range. Please help me with the code to resize the image also. I have pasted what I have written so far.
VBA Code:
Sub copy_image()
Set wsb = Worksheets("x")
Set wso = Worksheets("y")
wsb.Activate
Range("C1:H18").Select
Selection.Copy
wso.Select
Range("AG64:AY81").Select
wso.Pictures.Paste(Link:=True).Select
ActiveSheet.Shapes.Range(Array("Picture 104")).Select '--> Picture 104 is what was defined by excel for the last image it pasted. This is hard coded and cannot be used for anything else.