Dim
MovieTitle
As
Range
Dim
MoviePoster
As
String
Dim
ImageFolderPath
As
String
Dim
ImagePath
As
String
Dim
MovieName
As
String
Dim
lngZiel
As
Long
MovieName = txtMovieName.Value
ImageFolderPath = Environ(
"UserProfile"
) &
"\Desktop\Movie Database\Movie Posters"
ImagePath = ImageFolderPath &
"\" & MovieName & "
.jpg"
imgMoviePoster.Picture = LoadPicture(ImagePath)
MoviePoster = ImageFolderPath &
"\" & MovieName & "
.jpg"
Set
MovieTitle = Range(
"P:P"
).Find(txtMovieName.Value, MatchCase:=
True
, LookAt:=xlWhole)
If
Not
MovieTitle
Is
Nothing
Then
With
Cells(MovieTitle.Row,
"P"
)
.AddComment
.Comment.Shape.Fill.UserPicture MoviePoster
.Comment.Visible =
False
End
With
Else
lngZiel = Range(
"P2"
).
End
(xlDown).
End
(xlDown).
End
(xlUp).Row + 1
With
Cells(lngZiel,
"P"
)
.Value = txtMovieName.Value
.AddComment
.Comment.Shape.Fill.UserPicture MoviePoster
.Comment.Visible =
False
End
With
End
If