The Address Book That Contains Pictures

Adding Images To Userform Records


           In this study, we created an address book that views the picture according to records.With button, the selected image from computer can be added to the item and can be deleted.

The file path of the selected picture is assigned to the empty cell :(C:\Project_1\NewPictures\TestImage3.jpg) etc.

           This picture is displayed on the userform with Image Control(Image control is used to display a picture on the userform).


excel address book with image

"Add Image" button codes to add images :
Private Sub CommandButton9_Click()
Dim ara As Range, dosya As Variant
If TextBox1 = "" And TextBox3 = "" Then
MsgBox "Not Any Item Selected", vbCritical
Exit Sub
Else
dosya = Application.GetOpenFilename(FileFilter:="," & "*.jpg;*.gif;*.jpeg;*.bmp;*.GIF;*.JPG;*.tiff;*.tif",Title:="Please Choose An Image")
If dosya = False Then
MsgBox "Image Not Selected", vbCritical
Exit Sub
Else
Image3.Picture = LoadPicture("")
Set ara = Sheets("liste").Range("B:B").Find(ListBox1, , xlValues, xlWhole)
If Not ara Is Nothing Then
Sheets("liste").Cells(ara.Row, 10).Value = yol & dosya & uzanti
Image3.Picture = LoadPicture(yol & dosya & uzanti)
End If
End If
End If
End Sub

8 comments:

  1. great and many thanks for sharing

    ReplyDelete
  2. Muy bueno altamente recomendable

    ReplyDelete
  3. hello. I'm in touch with you from Mongolia.
    I want to use this model that you created in the student database.
    But one problem is not solved.

    Additionally, combobox is added to the sex section. Controls ("textbox" & a + 1) = ListBox1.Column (a) how to fix the error.

    ReplyDelete
  4. Dear Sir, thanks for this, just want to know how to show the headers in listbox and there is only one search box to search data, what if we want to search multiple data like the advance filter. please tell this
    Anand Chaudhari
    email:-achaudhari.online@gmail.com

    ReplyDelete
  5. Hi Mr. Kadr. I feel so frustrated that I could not download any of your amazing programs.

    ReplyDelete
    Replies
    1. Problem on downloading solved by changing the DNS. I am copying the image related codes to the New Updated User Form (15 columns but I made this to 20 columns). I am still having run time errors. May I know what yol, dosya and uzanti mean? Do I need to change the below lines?
      Sheets("liste").Cells(ara.Row, 10).Value = yol & dosya & uzanti
      Image3.Picture = LoadPicture(yol & dosya & uzanti)
      Thank you.

      Delete
  6. Hi,
    the first blank column number must be written :
    Sheets("liste").Cells(ara.Row, 16).Value = yol & dosya & uzanti
    Image3.Picture = LoadPicture(yol & dosya & uzanti)

    ReplyDelete