I am trying to automate some procedures for creating paperwork for my company to help streamline our processes. Currently I have been trying to create an input macro where you choose a photo to select and it inputs into cell F5 on sheet one (to confirm that it has been inputted) as well as inputting them into a couple of forms that require the photo graphs in them as well (Sheet3 cells C822 and C988). However I have been running into an issue where I cannot get the photo to be inputted into the correct cell.
The cells that the pictures need to be inserted into are:
F5 in Sheet 1
C822 in Sheet 3
C988 in Sheet 3
My current code:
Sub InsertPicture()
Dim photoNameAndPath As Variant
Dim photo As Picture
Dim ws As Worksheet
Set ws = Sheet3
photoNameAndPath = Application.GetOpenFilename(Title:=”Select Photo to Insert”)
If photoNameAndPath = False Then Exit Sub
Set photo = ws.Pictures.Insert(photoNameAndPath)
photo_cell = ws.Range("C822")
photo.Left = Range("C822")
photo.Top = Range("C822")
With photo
.Width = 100
.Height = 93
End With
End Sub
Any help that could be given would be greatly appreciated.
I have been trying to get the macro to input the photo into specific cells on sheet 3.
Currently when the macro is run it inputs the photo at the top of the sheet at cell K1.
Hanno2148 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.