473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Find cell from textbox input

I've just started trying to code in VB6 and need a little help please....

When user enters tel number in textbox, what code do I need which will search for that number (in a particular column) in Excel. I need this so I can populate other text boxes in my form with the remaining cells' data in that row.

Hope this makes sense. Any help would be appreciated.
Feb 4 '10 #1

✓ answered by Guido Geurs

dear,


Is this what you want? (see attachment)


br,

6 1915
Guido Geurs
767 Expert 512MB
dear,

I hope this will help:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton1_Click()
  2.    Worksheets("Sheet1").Activate
  3.    Range("A1").Activate
  4.    Do While ActiveCell.Value <> ""
  5.       If ActiveCell.Value = TextBox1.Text Then TextBox2.Text = ActiveCell.Offset(0, 1)
  6.       ActiveCell.Offset(1, 0).Activate
  7.    Loop
  8. End Sub

see also attachment for an example.


br,
Attached Files
File Type: zip EXCEL lookup in range_v1.zip (10.0 KB, 70 views)
Feb 5 '10 #2
Thanks for the help Guido. Did you get my PM?
Feb 7 '10 #3
Guido Geurs
767 Expert 512MB
dear,

In your PM is only a link to:

C:\Documents and Settings\Owner\Desktop\test.zip

This is no link to a file on BYTES.

If you want to set a file on the server, you have to go to the call and klick on : "Post replay"
There you can attach a file by clicking on the button "Manage Attachments"
Browse to your ZIP file wich is on :

C:\Documents and Settings\Owner\Desktop\test.zip

Click on "Upload"
Now the file is on the BYTES server from where I can download it.
Click on "Close this window" on the bottom of the page.

Now you are back on the "post replay" page and click on "Submit reply" to send it to me.

br,
Feb 8 '10 #4
Hi again

Thanks for that. You can probably tell I've never uploaded on forums before!!!

Hope you get this ok.
Attached Files
File Type: zip test.zip (20.4 KB, 72 views)
Feb 8 '10 #5
Guido Geurs
767 Expert 512MB
dear,


Is this what you want? (see attachment)


br,
Attached Files
File Type: zip test_v1.zip (18.4 KB, 82 views)
Feb 9 '10 #6
Thanks so so much. That's EXACTLY what I was after. This is a big help.
Feb 9 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
6
by: tshad | last post by:
I have a cell with 2 items in it: a textbox and a link. The link is actually a button (image), but for the example I am using a link, which is doing the same thing. Here is the stripped down...
4
by: Roger | last post by:
I have a datagrid and would like to know what even fires when a cell is changed? I want to know when the user changes a cell and moves to the next. I have some code that needs to be done to...
3
by: Jeff | last post by:
Help.. I have been using: string sId = ((System.Web.UI.WebControls.TextBox)e.Item.Cells.Controls).Text; To get the value of a cell in my datagrid. When I set the cell to read only, I get...
7
by: Arne Beruldsen | last post by:
in vbnet2005 I have a datagridview. When the user clicks on a row...I would like the contents of certain cells to populate a textbox. To do this...i need to be able to refer to the row and...
1
by: qiong | last post by:
Dear friends, Good evening, I have some problems with finding keyword ":\" for each cell. My objective is to find that keyword in each cell in each worksheet which represent the link. Eg:...
0
by: golf32902 | last post by:
Is there a way to have a textbox in a userform insert text into a cell and when i go back to it that it will add the text that is in the cell back in the textbox for more input ?
12
by: cj | last post by:
When viewing a datatable in a datagridview one of the columns in it is a "note" field which can be quite long. I would like to have the note field of the currently selected row of the datagrid...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.