Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello from Steved
The below will find what I require in Column C ie 002 What do I need to do please for it to search Col C for 002 and Col D for 3.30 Both are on the same row. Thankyou. Sub FindPart() Dim res Dim RgToSearch As Range, RgFound As Range Set RgToSearch = ActiveSheet.Range("C:C") res = Application.InputBox("Type School Number", "Find School", , , , , , 2) If res = "False" Then Exit Sub 'exit if Cancel is clicked res = Trim(UCase(res)) If res = "" Then Exit Sub 'exit if no entry and OK is clicked Set RgFound = RgToSearch.Find(what:=res, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=False) If RgFound Is Nothing Then MsgBox "School " & res & " not found." Else Application.Goto Reference:=RgFound.Offset(0, -1).Address(True, True, xlR1C1) End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search for matches in two columns | Excel Worksheet Functions | |||
search multiple columns | Excel Discussion (Misc queries) | |||
Search Across Multiple Columns | Excel Discussion (Misc queries) | |||
search columns, set variable value | Excel Programming | |||
using autofilter to search 2 columns | Excel Programming |