Reputation: 29
I work with one of my project where I have list of d:\Project\customer.xls. In the list there is No, Name, Sex, Telephone, Date of Birth, ID Card, IA Code. Therefore, I design a search button by type in "Phone Number" and with success search it will show Name, DoB, ID card and IA code on the text box accordingly.
This link help me with import from excel to datatable but from here ... how can i get specific data to show in textbox accordingly?
Upvotes: 1
Views: 302
Reputation: 2438
Using VBA
(not VB.Net
) you can set the <TextBoxName>.Text = ThisWorkbook.<Sheet>.Range(<TheCellAddress>)
You can use .Text
or .Value
as you see fit on both the textbox and the range. In addition, you can also use .Range(...).Value
, but this is the default response anyway if you don't use a Set <variable>= ...
type statement.
If you are using VB.Net
through the interop assemblies, you can do the same thing. The VB.Net language has some more efficient and cleaner ways to manipulate strings.
Upvotes: 1