Picture resizing to a range of cells

Geo000

Board Regular
Joined
Apr 2, 2015
Messages
60
Sub Show_DogPic()
Dim PicPath As String
With Sheet2
On Error Resume Next
.Shapes("DogPic").Delete 'Delete Picture if it exists
On Error GoTo 0
PicPath = .Range("BI1").Value 'Path of the picture
If PicPath = "0" Then
.Shapes("DefaultPicture").Visible = msoCTrue
Exit Sub
End If
.Shapes("DefaultPicture").Visible = msoFalse
With .Pictures.Insert(PicPath)
With .ShapeRange
.LockAspectRatio = msoTrue
.Height = 72
.Name = "DogPic"
End With 'Shape Range
End With 'Pictures

With .Shapes("Dogpic")
.Left = Sheet2.Range("BA3").Left
.Top = Sheet2.Range("BA3").Top
.IncrementLeft 3
.IncrementTop 4



End With 'Sheet2
End With
End Sub

Hi All
could anyone tell me how i can resize the pictures to a specific range of cells as some are larger in height and some just aint got the width
im starting to pull my hair out now with this any help greatly appreciated. ??
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi
sorry forgot to say i need the pic to fill cells BA3:BE7 so i would need to Auto resize some how ????
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top