Hello, I am new to VBA. I'm trying to use these code but a compile error message 'Expected End Sub' keeps poping up on first line of code.
I need your help please.
Sub Show_EmplPic()
Dim PicPath As String
With Sheet1
On Error Resume Next
.Shapes("EmplPic").Delete 'Delete Picture if it exists
On Error GoTo 0
PicPath = .Range("J10").Value 'Path of the Picture
If PicPath = Empty Then
.Shapes("DefaultPicture").Visible = msoCTrue
Exit Sub
End If
.Shapes("DefaultPicture").Visible = msoFalse
With .Pictures.Insert(PicPath)
With .ShapeRage
.LockAspectRatio = msoTrue
.Heihgt = 95
.Name = "EmplPic"
End With 'Shape Range
End With 'Pictures
With .Shapes("EmplPic")
.Left = Sheet1.Range("I5").Letf
.Top = Sheet1.Range("I5").Top
.IncreamentLeft 50
.IncreamentTop 15
End With
I need your help please.
Sub Show_EmplPic()
Dim PicPath As String
With Sheet1
On Error Resume Next
.Shapes("EmplPic").Delete 'Delete Picture if it exists
On Error GoTo 0
PicPath = .Range("J10").Value 'Path of the Picture
If PicPath = Empty Then
.Shapes("DefaultPicture").Visible = msoCTrue
Exit Sub
End If
.Shapes("DefaultPicture").Visible = msoFalse
With .Pictures.Insert(PicPath)
With .ShapeRage
.LockAspectRatio = msoTrue
.Heihgt = 95
.Name = "EmplPic"
End With 'Shape Range
End With 'Pictures
With .Shapes("EmplPic")
.Left = Sheet1.Range("I5").Letf
.Top = Sheet1.Range("I5").Top
.IncreamentLeft 50
.IncreamentTop 15
End With