Insert and resize a picture in Excel with VBA. Insert pictures from another location on your computer. Select the picture by entering the name on the excel sheet. Resize the picture to fit the cell size on your sheet. Allow me teach you the skills in Excel that you need for business
Let me teach you the VBA that I have learn in my five years of consulting
Become an Affiliate and earn 25% on Course Sales
Code
Sub Picture()
Dim pictname As String
Dim pastehere As Range
Dim pasterow As Long
Dim x As Long
Dim lastrow As Long
lastrow = Worksheets(“sheet1”).Range(“B1”).CurrentRegion.Rows.Count
x = 2
For x = 2 To lastrow
Set pastehere = Cells(x, 1)
pasterow = pastehere.Row
Cells(pasterow, 1).Select ‘This is where picture will be inserted
pictname = Cells(x, 2) ‘This is the picture name
ActiveSheet.Pictures.Insert(“C:UsersBarbPicturesdemo” & pictname & “.jpg”).Select ‘Path to where pictures are stored
With Selection
.Left = Cells(pasterow, 1).Left
.Top = Cells(pasterow, 1).Top
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = 80#
.ShapeRange.Width = 80#
.ShapeRange.Rotation = 0#
End With
Next
End Sub
For more help visit my website or email me at [email protected].
Contact me regarding customizing this template for your needs.
Excel one-on-one on-line training available. Email me to arrange.
I am able to provide online help on your computer at a reasonable rate.
Check out my next one-hour Excel Webinar
I use a Blue condensor Microphone to record my videos, here is the link
Check out Crowdcast for creating your webinars
If you need to buy Office 2019 follow
I use Tube Buddy to help promote my videos
Check them out
Follow me on Facebook
TWEET THIS VIDEO
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.