Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Searching for a request form TRACYJ503 Excel Discussion (Misc queries) 1 February 13th 08 10:40 PM
Searching for a Appraisal form for Gems stomes and pearls Min Excel Worksheet Functions 0 November 23rd 07 12:12 PM
Searching by an User Form Freshman Excel Worksheet Functions 0 January 31st 07 06:24 AM
Searching a spreadsheet Ryan Excel Discussion (Misc queries) 4 July 24th 06 11:57 PM


All times are GMT +1. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"