+ Reply to Thread
Results 1 to 6 of 6

simple search macro

Hybrid View

  1. #1
    Registered User
    Join Date
    11-12-2006
    Posts
    42

    simple search macro

    when i press ctrl +f in excel the find box comes up, i tried recording a macro to do this but it wouldnt work, can some one write me out a code or tell me how to make this macro so i attach it to a button.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    I hope that I've understood your question correctly.

    To attach a macro to a control keystroke, use TOOLS-MACRO-OPTIONS

  3. #3
    Registered User
    Join Date
    11-12-2006
    Posts
    42
    i did mate ive been fooling around with it for ages now and it wont work

  4. #4
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    If I understand you correctly, you don't need to record a macro to do that. Excel already has a button that you can add to your toolbar so that you can just click to Find. (If you didn't want to have to supply criteria, then you'd need a macro, but to just have the Find pop up, you don't need a macro.)

    I did a quick search, and here's one place that shows how to customize your toolbar.

    http://www.uwec.edu/help/ExcelXP/env...tm#Customizing

    When you're choosing the function you want (looking at the above page as a reference), you want the Tools Menu, the Customize submenu. Then choose the Commands tab. Choose the Edit category. On the Commands side, scroll down until you see the Find button. (Should be binoculars as the icon).

    Drag that icon to the location you want on the desktop.

    Scott

  5. #5
    Registered User
    Join Date
    11-12-2006
    Posts
    42
    thanks man your a star

  6. #6
    Registered User
    Join Date
    11-19-2006
    Posts
    26

    RE: search macro

    Below is a macro I use to search the first row of a sheet for certain text, a name in this case, based on user input. You can alter it to suit your needs.

    Sub FindName()
    Dim MyName As String, r As Range
    MyName = InputBox("ENTER FIRST OR LAST NAME", "GO TO NAME")
    Set r = Rows(1).Find(MyName, , xlFormulas, xlPart)
    If r Is Nothing Then
    MsgBox "Not Found"
    Exit Sub
    End If
    Application.GoTo r, True
    End Sub

+ Reply to Thread

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