Howdy,
This is what I am trying to do....I have a part spec list and I also have photos of each part in separate files. The spec list utilizes vlookup formulas to recall the specs from the data sheet. I would like a photo to be included on the sheet. Since the path to the photos are all the same except for the title which is the part number, I can easily create the correct a variable path utilizing a formula. What I was trying to do was create a macro that would copy and paste the path into inserting the photo and I can't seem to get it to work. It will do it for the first example recorded into the macro but as you change the path the macro will not change with it because when it is recording it is saving what is in the cell at that time instead of the cell location so that it could be variable. Unfortunately I do not know enough about editing macros to be able to change this to what is needed. I have copied a sample of the macro below and will blue highlight where I believe the problem lies:
Sub SpecPhotoMacro()
'
' SpecPhotoMacro Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Range("D6").Select
Selection.Copy
Range("D9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Pictures.Insert( _
"C:\Users\rboevers\Pictures\New folder\image6.jpeg").Select
Selection.ShapeRange.ScaleWidth 0.6123737374, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.ScaleHeight 0.6123737374, msoFalse, _
msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft -330
Selection.ShapeRange.IncrementTop -181.5
Selection.ShapeRange.ScaleWidth 0.6371132397, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.6371131856, msoFalse, _
msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft 24
Selection.ShapeRange.IncrementTop -105
End Sub
Maybe there is an easier way of going about this?
Any/all help with this is greatly appreciated!!
Take care, Rick.
This is what I am trying to do....I have a part spec list and I also have photos of each part in separate files. The spec list utilizes vlookup formulas to recall the specs from the data sheet. I would like a photo to be included on the sheet. Since the path to the photos are all the same except for the title which is the part number, I can easily create the correct a variable path utilizing a formula. What I was trying to do was create a macro that would copy and paste the path into inserting the photo and I can't seem to get it to work. It will do it for the first example recorded into the macro but as you change the path the macro will not change with it because when it is recording it is saving what is in the cell at that time instead of the cell location so that it could be variable. Unfortunately I do not know enough about editing macros to be able to change this to what is needed. I have copied a sample of the macro below and will blue highlight where I believe the problem lies:
Sub SpecPhotoMacro()
'
' SpecPhotoMacro Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Range("D6").Select
Selection.Copy
Range("D9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Pictures.Insert( _
"C:\Users\rboevers\Pictures\New folder\image6.jpeg").Select
Selection.ShapeRange.ScaleWidth 0.6123737374, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.ScaleHeight 0.6123737374, msoFalse, _
msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft -330
Selection.ShapeRange.IncrementTop -181.5
Selection.ShapeRange.ScaleWidth 0.6371132397, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.6371131856, msoFalse, _
msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft 24
Selection.ShapeRange.IncrementTop -105
End Sub
Maybe there is an easier way of going about this?
Any/all help with this is greatly appreciated!!
Take care, Rick.