I have an asset list of 200+ items. I would like to add photos of each asset to its row. So far I have this command button vba
I need to be able to restrict the photo to the individual cell and be able to repeat the button for each asset. Ideally I would be able to search for the asset and then click add photo.
Any help or direction to other resources would be appreciated.
Thanks
P.S. I did not write the code above so please don't overestimate my ability I have the most basic understanding of any of this.
VBA Code:
Private Sub AddPicture_Click()
Dim strFileName As String
Dim objPic As Picture
Dim rngDest As Range
strFileName = Application.GetOpenFilename( _
FileFilter:="Images (*.jpg;*.gif;*.png),*.jpg;*.gif;*.png", _
Title:="Please select an image...")
If strFileName = "False" Then Exit Sub
Set rngDest = Me.Range("A10:D20")
Set objPic = Me.Pictures.Insert(strFileName)
With objPic
.ShapeRange.LockAspectRatio = msoFalse
.Left = rngDest.Left
.Top = rngDest.Top
.Width = rngDest.Width
.Height = rngDest.Height
End With
End Sub
Any help or direction to other resources would be appreciated.
Thanks
P.S. I did not write the code above so please don't overestimate my ability I have the most basic understanding of any of this.