Dear all,
I need your help with pic ratio inside the following formula.
The pic is correctly pasted in memo, the height changes to 200, but the original ratio is not maintained. Can you help me?
Sub showPic()
Dim folderPath As String
folderPath = ThisWorkbook.path & Application.PathSeparator
For Each cell In Selection
fileExt = cell.Value & ".jpg"
If Dir(folderPath & fileExt) = fileExt Then
MyPicture = folderPath & cell.Value & ".jpg"
With cell.AddComment
.Shape.Fill.UserPicture MyPicture
.Shape.Fill.UserPicture MyPicture
.Shape.LockAspectRatio = msoTrue
.Shape.Height = 200
End With
End If
Next cell
End Sub
I need your help with pic ratio inside the following formula.
The pic is correctly pasted in memo, the height changes to 200, but the original ratio is not maintained. Can you help me?
Sub showPic()
Dim folderPath As String
folderPath = ThisWorkbook.path & Application.PathSeparator
For Each cell In Selection
fileExt = cell.Value & ".jpg"
If Dir(folderPath & fileExt) = fileExt Then
MyPicture = folderPath & cell.Value & ".jpg"
With cell.AddComment
.Shape.Fill.UserPicture MyPicture
.Shape.Fill.UserPicture MyPicture
.Shape.LockAspectRatio = msoTrue
.Shape.Height = 200
End With
End If
Next cell
End Sub