LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default search 2 Columns Please

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
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
Search for matches in two columns Dingy101 Excel Worksheet Functions 11 December 10th 09 05:58 AM
search multiple columns jason2444 Excel Discussion (Misc queries) 1 August 28th 07 10:26 PM
Search Across Multiple Columns Efrain Excel Discussion (Misc queries) 1 February 8th 07 05:24 PM
search columns, set variable value Robert Excel Programming 2 March 23rd 05 06:49 PM
using autofilter to search 2 columns neowok[_11_] Excel Programming 6 February 19th 04 02:40 PM


All times are GMT +1. The time now is 10:19 PM.

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

About Us

"It's about Microsoft Excel"