Thursday, 24 March 2022

Use Vlookup formula in user form TextBox

 HOME PAGE    

   UPSC :-UPSC Prelims 2021 Paper Analysis I Indian Polity             UPSC Prelims 2021 Paper Analysis I Science & Technology                 UPSC Prelims 2021 Paper Analysis I Geography             IAS/PCS Essay Book  Paper Notice and syllabus :PET EXAMINATION SYLLABUS            PET QUESTION PAPER                 SINDHU GHATI SABHYATA                         GST                     B.Ed Second Year Book -2021                            DIGITAL INDIA                    CHILD LABOUR IN INDIA  Competitive Book :- GK/GS Book 2021                              All Competitive Maths Book                    All Competitive Resigning Book            Important Project :-Visual Studio C # Project      Tally Erp9 Account Feature      Microsoft  Excel VBA Project                    who to  apply mathematical Formula in ms excel user form                   MS Excel UserForm Save And Edit Button Part-1 Module          MS Excel UserForm Save And Edit Button Part-2 Module          Use Vlookup Formula in MS Excel UserForm     Purvanchal University Book :  Purvanchal University Sure Series Book pdf Youtube Class Note :  Maths 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:-

1. TextBox change Module 

2. TextBox Enter Module 

No comments:

Post a Comment

Seperation method of Glucose in Sugarcane using HPLC || HPLC का उपयोग करके गन्ने से ग्लूकोज को अलग करने का तरीका

 गन्ने में मौजूद ग्लूकोज (glucose) की मात्रा का विश्लेषण करने के लिए LC-MS एक बहुत ही प्रभावी तरीका है। यह तकनीक दो प्रमुख चरणों में काम करत...