Results 1 to 5 of 5

Search Box In Excel

Threaded View

  1. #1
    Registered User
    Join Date
    01-06-2010
    Location
    Lancashire
    MS-Off Ver
    Excel 2000
    Posts
    4

    Smile Search Box In Excel

    Can anyone help?

    I'm try to create a macro that searches the whole of a spreadsheet and finds any records that match.....

    I've managed to find this...

    Sub myfind()
    Dim Message, Title, Default, SearchString
    Message = "Enter Permit Number/Car Registration Number" ' Set prompt.
    Title = "Find Permit/Registration Number" ' Set title.
    Default = "" ' Set default.
    ' Display message, title, and default value.
    SearchString = InputBox(Message, Title, Default)
    
    'SearchString = "Rob"
    Set S = Sheets.Application
    For Each S In Application.Sheets
    With S.Range("A1:IV65536")
    Set F = .Find(SearchString, MatchCase:=True, LookAt:=xlWhole, LookIn:=xlValues)
    If F Is Nothing Then
    Else
    Location = F.Address
    S.Select
    Range(Location).Select
    Exit For
    End If
    End With
    Next S
    End Sub
    But what I really want it to do is search and display only the records that match and give an error message if nothing is found, anyone?
    Last edited by teylyn; 01-06-2010 at 07:59 AM. Reason: added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1