Visual Basic/Visual Basic program
I am working on MS Excel. I have created a VB form which i attached a image copy in which you will find a combo box drop down list which contain name of services. I have a master excel sheet named "Accounting code" which contain Name of Service with its respective codes.
My problem is i do not know much about VB, hence i want a program that auto fill up the other combo box in form (which are on left side in the Middle of Image) with corresponding data form the excel sheet which i mentioned above based on the name of the service i select from the drop down list from combo box. Is it possible in a same way like vlookup in excel? I am also attaching a excel sheet image copy. Hope i am clear.
ANSWER: What version of Visual Basic are you using? Visual Basic 6 or Visual Basic .NET?
---------- FOLLOW-UP ----------
QUESTION: Hi, Kevin,
Thank you for your response.
I am using VB 6.5 version
Take a look at the link below. It should at least get you started. If you have any questions please do not hesitate to ask a followup question.
Just some thoughts on the code:
you need to add a reference 'to the Microsoft excel 'xx' object library. Where XX refers to the version of Excel you are using. You most likely one have one version istalled. I am not sure but I believe each computer has to have the same version of Excel
You must have these three lines
Dim xl As New Excel.Application
Dim xlwbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
XL is used to refer to an instance of Excel
XLwbook is used to refer to a workbook
XLsheet refers to a worksheet You can refer to multiple sheets if you want