UPSC :- Paper Notice and syllabus : Competitive Book :- Important Project :- Purvanchal University Book : Youtube Class Note :
Vlookup Formula :-
Vlookup Formula is using the Filter the data in the data sheet . When You make the data sheet Then the so complication Work is search the write data in the data sheet . In this Problem solve by Vlookup using Formula.
Example :-
I go to a new MS Excel Sheet and put the name of sheet is "Data" , and make a Employee table like name, id , password, address, mobile number etc. Tell me dray a user form to using MS Excel VBA . I am put the name of Employee in the Combobox and Click the Command Button Refresh , All the Detail of Employee fill the other Textboxs.
Solution :-
Sheet name = "Data"
UserForm name = "Refresh Data"
ComboBox name = ComboBoxEmployee_Name
TextBox 1 name = TextBoxEmployee_Id
TextBox 2 name = TextBoxEmployee_Address
TextBox 3 name = TextBoxEmployee_Mobile_Number
Command Button 1 name = CommandButton_Refresh
Private Sub CommandButtonRefresh_Click()
Dim TableArray As Range, Employee Name As String
Set TableArray = Sheets("Data").Range("A:B")
Me.TextBoxEmployee_Id.Value = WorksheetFunction.VLookup(Me.ComboBoxEmployee_Name, TableArray, 2, 0)
Me.TextBoxEmployee_Address.Value = WorksheetFunction.VLookup(Me.ComboBoxEmployee_Name, TableArray, 3, 0)
Me.TextBoxEmployee_Mobile_Number.Value = WorksheetFunction.VLookup(Me.ComboBoxEmployee_Name, TableArray, 4, 0)
End Sub
2. Add Item In ComboBox :-
ComboBox using the checkout of Repeated entry . This Box is help the new data entry and worn the copy data . ComboBox is make the data Entry is Easy and fast.
Example :-
Make the ComboBox in UserForm and fix the list data in the data sheet . In this work UserForm_Initialize code is help to show the data in comboBox list. It is complete the two step to codding fist is Sub Product_List() and second is Private Sub UserForm_Initialize()
Sheet name = "Data"
UserForm name = "Refresh Data"
ComboBox name = ComboBoxEmployee_Name
Coding fist :-
It the codding of show the data in the comboBox list when we run the Program.
Private Sub UserForm_Initialize()
Call Product_List
End Sub
Codding Second :-
It is codding of Product list , Whose call in the fist codding module.
Sub Product_List()
Set sh = ThisWorkbook.Sheets("Data")
Dim i As Integer
Me.ComboBoxEmployee_Name.Clear
Me.ComboBoxEmployee_Name.AddItem ""
For i = 2 To Application.WorksheetFunction.CountA(sh.Range("A:A"))
Me.ComboBoxEmployee_Name.AddItem sh.Range("A" & i)
Next i
End Sub
Some other topics:-