Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I was wondering how to create a search function that would search column A for whatever was put in E1. I am completely new to this sort of thing. Sorry -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Record a macro that does a find for say 10.
This is under Edit, Find. Look at the produced code. Replace this bit: What:="10" with this: What:=Cells(5) RBS "Durzan" wrote in message ... I was wondering how to create a search function that would search column A for whatever was put in E1. I am completely new to this sort of thing. Sorry -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How do I make the formula search the data I put in E1 and limit it's search to column A? -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Is it possible to make a search fomula that searches column a for the text entered in E1 and displays the data listed in adjacent comumns. eg. I look up cars and it looks for cars in column A when it finds the result say A12 it displays the data in B12,C12,D12,E12 as well. so A12 displays in F1, C12 in G1 and so on -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Replace the bit in your recorded macro:
Cells with: Columns(1) RBS "Durzan" wrote in message ... How do I make the formula search the data I put in E1 and limit it's search to column A? -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI Durzan
Hopefully enough simple code below to get you going Sub Finder () dim what what = Range("e1").Value If what = "" Then MsgBox (" NO VALUE IN SOURCE CELL") If what = "" Then End Range("A1").Select Range(Selection, Selection.End(xlDown)).Select On Error GoTo 1000 Selection.Find(what:=what, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate ActiveCell.Offset(0, 1).Value = what MsgBox (" THE SEARCH ITEM ") & what & " WAS FOUND AT " & ActiveCell.Address End 1000: MsgBox ("THE ITEM WAS NOT FOUND") End sub Best N10 "Durzan" wrote in message ... Is it possible to make a search fomula that searches column a for the text entered in E1 and displays the data listed in adjacent comumns. eg. I look up cars and it looks for cars in column A when it finds the result say A12 it displays the data in B12,C12,D12,E12 as well. so A12 displays in F1, C12 in G1 and so on -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Firstly place a button on the spreadsheet from the control toolbox toolbar.
Then double click the button to go into the VBE and enter the following code in between Sub commandbutton1 () and End Sub Dim search, count, val1, val2 val1=Worksheets("Sheet1").Range("E1").Value count=0 While Search="ON" val1=Worksheets("Sheet1").Range("A1").Offset(count ,0).Value If val1=val2 Then 'Put what you want to do here once it has found the value in the column MsgBox "Found value in A:" and count Search="OFF" Else count=count+1 If count=1000 then MsgBox "Search did not find value in cells A1 to A1000" Exit Sub End If End If That should work nicely to find the value, but it would help if I knew what you wanted to do once its found the value. "Durzan" wrote: I was wondering how to create a search function that would search column A for whatever was put in E1. I am completely new to this sort of thing. Sorry -- Durzan ------------------------------------------------------------------------ Durzan's Profile: http://www.excelforum.com/member.php...o&userid=37447 View this thread: http://www.excelforum.com/showthread...hreadid=571126 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA search code | Excel Programming | |||
Search Code | Excel Programming | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming | |||
Search code | Excel Programming |