How to Create a Database in Excel with Pictures

  Рет қаралды 8,586

ExcelDemy

ExcelDemy

Күн бұрын

In this video, I'll guide you through the steps to create a database in Excel with pictures. In this detailed guide, you'll learn about UserForms, how to design UserForms, and assign VBA codes to the elements of the UserForm in order to make them functional. Moreover, you’ll also learn to make a search system for your database. This is particularly useful for searching and keeping track of employee information in a database. With practical examples and step-by-step instructions, you'll be able to make a database with pictures in your own Excel spreadsheets effortlessly.
👨‍🏫 Instructor: Eshrak Kader
🎥 Editor: Sadia Rahman
✨ ⯆ Resources:
Alt+F11 - To open the Visual Basic
▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
0:00 - Intro
1:07 - Creating Column Header Rows
1:59 - Designing UserForm and Entering Data into Database
9:39 - Writing the VBA Code to Store Data in the Database
13:39 - Running UserForm to Enter Data into Database
16:30 - Creating Database Search System
📚 ⯆ DOWNLOAD the workbook here:
www.exceldemy.com/how-to-crea...
🌍 ⯆ Checkout the article here:
www.exceldemy.com/how-to-crea...
💻 ⯆ Similar Videos:
• How to Maintain Custom...
• How to Create a Librar...
🚩 Stay connected with us on social media for more Excel tips and tricks!
Facebook: / exceldemy
Twitter: / exceldemy
LinkedIn: / exceldemy
🙋‍♂️ Stuck with an Excel formula or a VBA code? You can post your questions or upload your Excel file to get in touch with the professionals and get the solution you need.
ExcelDemy Forum: exceldemy.com/forum/
👉 If you found this video helpful, don't forget to subscribe to our channel for more Excel tutorials, tips, and tricks! Hit the subscribe button and turn on notifications, so you never miss an upload. By subscribing, you'll be supporting our channel and helping us to reach more people who can benefit from our content. Thank you for watching, and we'll see you in the next video!
🔔 ⯆ Subscribe on KZfaq:
/ @exceldemy2006
#excel #exceltutorial #exceltips #exceltricks

Пікірлер: 28
@mochamadfikri7921
@mochamadfikri7921 9 күн бұрын
Thank you so much. Very helpful..
@exceldemy2006
@exceldemy2006 8 күн бұрын
Hello @mochamadfikri7921, You are most welcome. we are so glad to hear that you found our video helpful. Keep leaning Excel with ExcelDemy. Regards ExcelDemy
@saiganeshnangunoori8018
@saiganeshnangunoori8018 2 ай бұрын
Not many videos on this topic ,and the explanation is simple.
@exceldemy2006
@exceldemy2006 2 ай бұрын
Dear, Thanks for your compliment! You are very welcome.
@fahimshahriyardipto3153
@fahimshahriyardipto3153 11 ай бұрын
Eshrak brother,,,the video is very informative...big fan of you.. Wish to meet with you one day.❤
@exceldemy2006
@exceldemy2006 11 ай бұрын
Thank you! Stay connected with Exceldemy for more helpful content! 🎉❤ Regards, Exceldemy Team!
@jerryscde1
@jerryscde1 3 ай бұрын
The video is informative thank you very much
@exceldemy2006
@exceldemy2006 3 ай бұрын
Hello @jerryscde1, You are most welcome. Thanks for your appreciation it means a lot to us. Please stay connected with us. Regards ExcelDemy
@darlingtons.kolleh3400
@darlingtons.kolleh3400 Ай бұрын
Thank you so much.
@exceldemy2006
@exceldemy2006 Ай бұрын
You're welcome!
@darlingtons.kolleh3400
@darlingtons.kolleh3400 Ай бұрын
You are very excellent.
@exceldemy2006
@exceldemy2006 Ай бұрын
Many many thanks
@rabiuahmad2689
@rabiuahmad2689 11 ай бұрын
Good job, it should be better if add delete and edit buttons
@exceldemy2006
@exceldemy2006 11 ай бұрын
Hello @rabiuahmad2689, Thank you for your query. Yes, you correctly pointed out that it would be more convenient if we added an edit button for inserting new entries. However, regarding the delete button, there is already a delete button for removing the selected image. We appreciate your suggestion and feedback and hope to implement the changes soon. Regards ExcelDemy
@user-cn7nq9yd6e
@user-cn7nq9yd6e 11 ай бұрын
Update, Delete,Surch Button necessary
@exceldemy2006
@exceldemy2006 4 ай бұрын
Dear, The delete button is given to the database userform and the search option is given in another sheet. We will add the update button in our next video. Thanks for being with us.
@katchylicious
@katchylicious 17 күн бұрын
How do you create this search system
@exceldemy2006
@exceldemy2006 16 күн бұрын
Hello @katchylicious, You can follow our article Step-5 to create the search system: www.exceldemy.com/how-to-create-a-database-in-excel-with-pictures/#search-system You also can copy the given VBA code and paste it in the Module to create the search system: Sub ExtendNamedRange() Dim lastRow As Long Dim ws As Worksheet Dim namedRange As Range Set ws = ThisWorkbook.Worksheets("Sheet1") Set namedRange = ws.Range("A1").CurrentRegion lastRow = namedRange.Rows.Count With ws .Names.Add Name:="db_Sheet", RefersTo:=.Range("A1:G" & lastRow) End With End Sub Sub DeleteAllPictures() Dim pic As Shape For Each pic In ActiveSheet.Shapes If pic.Type = msoPicture Then pic.Delete End If Next pic End Sub Sub Get_Details() Dim look_up_Value As Variant Dim look_up_Range As Range Dim result As Variant ' Set the lookup value look_up_Value = Worksheets("Sheet2").Range("F5").Value ' Set the lookup range Set look_up_Range = Worksheets("Sheet1").Range("db_Sheet") ' Perform the VLOOKUP and store the result For i = 1 To 5 Worksheets("Sheet2").Range("C5").Cells(i, 1).Value _ = Application.WorksheetFunction.VLookup(look_up_Value, look_up_Range, i + 1, False) Next i End Sub Sub Employee_Pic() On Error GoTo ErrHandl 'Deleting Existing Pictures Call DeleteAllPictures Dim picName As String Dim picHeight As Double Dim picWidth As Double picName = "Pic" & Range("F5").Value 'Copy the picture from Sheet1 and paste it into Sheet2 Sheets("Sheet1").Shapes(picName).Copy Sheets("Sheet2").Range("C4").PasteSpecial 'Name the pasted picture in Sheet2 with the original name from Sheet1 Sheets("Sheet2").Shapes(Sheets("Sheet2").Shapes.Count).Name = picName 'Set the height and width of the cell to match the pasted picture's dimensions 'determining actual pic width and height picHeight = Sheets("Sheet2").Shapes(picName).Height picWidth = Sheets("Sheet2").Shapes(picName).Width 'determining aspect ration aspect_Ratio = picWidth / picHeight picHeight = Sheets("Sheet2").Range("C4").RowHeight - 5 picWidth = aspect_Ratio * picHeight 'Setting new height and width Sheets("Sheet2").Shapes(picName).Height = picHeight Sheets("Sheet2").Shapes(picName).Width = picWidth 'Center and middle align the pasted picture inside the cell Cell_Height = Sheets("Sheet2").Range("C4").Height Cell_Width = Sheets("Sheet2").Range("C4").Width With Sheets("Sheet2").Shapes(picName) .Top = Sheets("Sheet2").Range("C4").Top + (Cell_Height / 2) - (.Height / 2) .Left = Sheets("Sheet2").Range("C4").Left + (Cell_Width / 2) - (.Width / 2) End With Call Get_Details Exit Sub ErrHandl: MsgBox "No Data Found of this employee" For i = 1 To 5 Worksheets("Sheet2").Range("C5").Cells(i, 1).Value = "Not Found" Next End Sub Here is our Excel file link: www.exceldemy.com/wp-content/uploads/2023/05/how-to-create-a-database-in-excel-with-pictures-1.xlsm You will find the full database here. Regards ExcelDemy
@BudiSetiawan-ko6yf
@BudiSetiawan-ko6yf 11 ай бұрын
it's cool to continue with class edit and delete
@exceldemy2006
@exceldemy2006 11 ай бұрын
Thank you! Stay connected with Exceldemy for more helpful content! 🎉❤ Regards, Exceldemy Team!
@Hanumantha
@Hanumantha 9 ай бұрын
Can you share the code as I cannot see the full code on the screen
@exceldemy2006
@exceldemy2006 9 ай бұрын
Hello, Hanumantha! Please download the practice workbook, you will get the code there. Link: www.exceldemy.com/how-to-create-a-database-in-excel-with-pictures/#download Stay connected with Exceldemy for more helpful content! 🎉❤ Regards, Exceldemy Team!
@kathrynbauer8641
@kathrynbauer8641 Ай бұрын
Seemed easy to follow until i noticed that he added underscores to the NAMES and not others? I'm not a coder just trying to get a functional form.. how do i get your code to copy and paste?
@exceldemy2006
@exceldemy2006 Ай бұрын
Hello @kathrynbauer8641, You can get the code from the article, link is given in the description. I'm attaching it here too: www.exceldemy.com/how-to-create-a-database-in-excel-with-pictures/ Here is the VBA code: Option Explicit: Dim database As Worksheet Dim imagePath As Variant Dim db_range As String Dim r As Long 'representing first empty row from the top Public Function lastRow(ws As Worksheet) As Long lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row End Function Private Sub UserForm_Activate() Set database = Worksheets("Sheet1") r = lastRow(database) + 1 db_range = "A1:G" & r End Sub Private Sub cmdSave_Click() On Error Resume Next r = lastRow(database) + 1 database.Range("A1").Cells(r, 1) = Database_Entry_Form.txtEmpNo.Value database.Range("A1").Cells(r, 2) = Database_Entry_Form.txtEmpName.Value database.Range("A1").Cells(r, 3) = Database_Entry_Form.txt_Add.Value database.Range("A1").Cells(r, 4) = Database_Entry_Form.txt_Tel.Value database.Range("A1").Cells(r, 5) = Database_Entry_Form.txt_Designation.Value database.Range("A1").Cells(r, 6) = Database_Entry_Form.txt_DOB.Value If (IsNull(img_Emp.Picture)) Then 'do nothing Else Dim selectedCell As Range Dim imgHeight As Long Dim imgWidth As Long Dim imgRatio As Double Dim img As Shape 'get selected cell Set selectedCell = database.Range("A1").Cells(r, 7) 'get image height and width imgHeight = img_Emp.Picture.Height imgWidth = img_Emp.Picture.Width 'resize image height to 40 while maintaining aspect ratio imgRatio = imgHeight / imgWidth imgHeight = 40 imgWidth = imgHeight / imgRatio 'set row height of selected cell to match image height selectedCell.EntireRow.RowHeight = imgHeight + 5 selectedCell.HorizontalAlignment = xlCenter selectedCell.VerticalAlignment = xlCenter 'insert image in selected cell Set img = ActiveSheet.Shapes.AddPicture(Filename:=imagePath, _ LinkToFile:=msoFalse, _ SaveWithDocument:=msoTrue, _ Left:=selectedCell.Left + (selectedCell.Width - imgWidth) / 2, _ Top:=selectedCell.Top + (selectedCell.Height - imgHeight) / 2, _ Width:=imgWidth, _ Height:=imgHeight) img.Name = "Pic" & Database_Entry_Form.txtEmpNo.Value End If Call ExtendNamedRange End Sub Regards ExcelDemy
@LeeKobe1
@LeeKobe1 4 ай бұрын
Excellent video tutorial, but couldn't this be done completely in Visual Basic? I guess I don't see the need for it to be done in Excel, but maybe I'm missing something....
@exceldemy2006
@exceldemy2006 3 ай бұрын
Dear, Thanks for the compliment. You're right. Using Visual Basic alone can be a more direct approach. But here, we have provided a solution for those who like working with Excel.
@user-cn7nq9yd6e
@user-cn7nq9yd6e 11 ай бұрын
Update, surch, Delete button
@exceldemy2006
@exceldemy2006 4 ай бұрын
Hello @user-cn7nq9yd6e @user-cn7nq9yd6e Thank you for your query. Yes, you correctly pointed out that it would be more convenient if we added an edit button for inserting new entries. However, regarding the delete button, there is already a delete button for removing the selected image. There is also a search button on another page. We appreciate your suggestion and feedback and hope to implement the changes soon. Regards ExcelDemy
EASILY Make an Automated Data Entry Form in Excel
14:52
Kenji Explains
Рет қаралды 410 М.
How to Create Leave Tracker in Excel
25:10
ExcelDemy
Рет қаралды 31 М.
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН
New model rc bird unboxing and testing
00:10
Ruhul Shorts
Рет қаралды 23 МЛН
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 29 МЛН
How to Create a Data Entry Form in Excel
34:30
Excel Macro Mastery
Рет қаралды 263 М.
How to Create Floating Cells in Excel
13:14
ExcelDemy
Рет қаралды 21 М.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
Excel Campus - Jon
Рет қаралды 111 М.
Fully Automated Data Entry User Form in Excel - Step By Step Tutorial
35:41
How To Create A Fillable Form With A Submit Button In Excel
29:20
Melissa Compton
Рет қаралды 130 М.
VBA User Form: Add, Update, Delete and Save
22:47
hay kel
Рет қаралды 27 М.
SUPER EASY Excel Data Entry Form (NO VBA)
6:22
Leila Gharani
Рет қаралды 2 МЛН
Excel VBA: Create a form with an image
18:58
hay kel
Рет қаралды 9 М.
Highlight Active Row & Column in Excel (7 Levels)
22:56
Victor Chan
Рет қаралды 39 М.
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН