Related:
- Inserting pictures
- How to auto save pictures in messenger - Guide
- Turn off pictures - Guide
- Offline pictures for whatsapp - Guide
- Inserting a tick in word - Guide
- How to rotate multiple pictures at once windows 10 - Guide
Feb 16, 2019 at 03:16 PM
What it does is to insert the picture from the folder.
But I want this picture to be inserted is a certain cell in another worksheet.
Is it possible?
Please I need your help,
God bless!!
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range) 'Excel VBA procedure to incorporate Pictures from folder.
Dim rng As Range
Set rng=Application.Intersect(Range("A10:A20"), Target.Cells(1, 1))
If rng Is Nothing Then Exit Sub
GetPicture rng
End Sub
Sub GetPicture(r As Range)
Dim fName As String
Dim s As String
fName="C:\Users\HYMC\Pictures\" & r & ".jpg" 'Change to suit.
s="B" & r.Row
r.RowHeight=75 'pixels
On Error Resume Next
ActiveSheet.Pictures(s).Delete 'Delete the picture
Set pic=ActiveSheet.Pictures.Insert(fName)
On Error GoTo 0
If Not IsEmpty(pic) Then
With pic 'Resize the picture with VBA
.Height=75
.Width=75
.Left=Range(s).Left
.Top=Range(s).Top
.Name=s
End With
End If
End Sub