Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a spreadsheet using a vba form
I have a spreadsheet, with three column with data. I would like to b
able to search for specific data (or values) using a form made in VBA On the form, there are three text boxes, one for each column. If enter data in textbox1, it should search for this in column 1 in th spreadsheet. Same goes for the other textboxes/columns. When having entered data in one textbox, the other two should be graye out, in order not to b able to enter data in those. Have attached a file for easy reference. Any help will be appreciated Attachment filename: eurcos.xls Download attachment: http://www.excelforum.com/attachment.php?postid=59165 -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a spreadsheet using a vba form
There are a couple of possible variables to exactly what you want t
achieve. You may need to come back. This is the basic search :- Code ------------------- Private Sub CommandButton1_Click() Dim foundcell As Object myvalue = TextBox1.Value Set foundcell = ActiveSheet.Columns(1).Find(myvalue) If foundcell Is Nothing Then MsgBox ("Not found.") Else foundcell.Select End If End Sub ------------------- -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Searching a spreadsheet using a vba form
BrianB,
That worked fine. There is a few other things I need as well: 1. When searching for the value in textbox1, there might be more cell with the same result than just one. I need all cells to be selected. 2. As mentioned, there are three textboxes in the form, and only th one with a value in it, should be used for the search. How is tha done? Thnks -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel form. Need data extracted to spreadsheet each time a form co | Excel Discussion (Misc queries) | |||
Searching for a request form | Excel Discussion (Misc queries) | |||
Searching for a Appraisal form for Gems stomes and pearls | Excel Worksheet Functions | |||
Searching by an User Form | Excel Worksheet Functions | |||
Searching a spreadsheet | Excel Discussion (Misc queries) |