magik_johnson
New Member
- Joined
- Nov 14, 2018
- Messages
- 2
Hi all,
Apologies if i have posted this in the wrong place!
Im trying to make it simple for users of a workbook to insert an image. So far I have inserted an activeX image control and used this code (found online) so they can select an image to add to the cell-
Private Sub Image1_Click()
With Application.Dialogs(xlDialogInsertPicture)
If .Show = True Then
With Selection.ShapeRange
.Width = Image1.Width
.Height = Image1.Height
.Top = Image1.Top
.Left = Image1.Left
End With
End If
End With
End Sub
My issue is that I need the inserted image to automatically re-size to the the dimensions of the cell it is inserted into. I've tried a few things but my knowledge of VBA is pretty much non-existent!
Any help would be really appreciated!
Thanks
Apologies if i have posted this in the wrong place!
Im trying to make it simple for users of a workbook to insert an image. So far I have inserted an activeX image control and used this code (found online) so they can select an image to add to the cell-
Private Sub Image1_Click()
With Application.Dialogs(xlDialogInsertPicture)
If .Show = True Then
With Selection.ShapeRange
.Width = Image1.Width
.Height = Image1.Height
.Top = Image1.Top
.Left = Image1.Left
End With
End If
End With
End Sub
My issue is that I need the inserted image to automatically re-size to the the dimensions of the cell it is inserted into. I've tried a few things but my knowledge of VBA is pretty much non-existent!
Any help would be really appreciated!
Thanks