+ Reply to Thread
Results 1 to 5 of 5

Possible? Macro that will search and locate a colum of info

Hybrid View

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    Edmonton, Alberta Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Possible? Macro that will search and locate a colum of info

    I am working on a data base that tracks employees training certificates. I was wondering if it is possible to create a macro or something that will bring up all the info on a specified employee in the [active] sheet, This workbook contains 8 sheets?
    I was hoping to be able to make a button you click then it would allow you to enter the persons name and then locate the column of info in relation to the name entered in the [active] sheet.

    I have used macro's before but I am sort of self taught and am lost as to how to go about building something like this..
    Attached Files Attached Files
    Last edited by sdehod; 10-17-2013 at 12:31 PM.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Possible? Macro that will search and locate a colum of info

    Maybe something from this thread? It's possible but you probably will need to post a sample workbook to get some help.

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    Edmonton, Alberta Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Possible? Macro that will search and locate a colum of info

    Attachment 271712 here is the excel form I am trying to create a macro for. I have the button on the sheet1 just not sure what to do from there?

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Possible? Macro that will search and locate a colum of info

    Do you have a sample you can provide with your layout? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  5. #5
    Registered User
    Join Date
    10-15-2013
    Location
    Edmonton, Alberta Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Possible? Macro that will search and locate a colum of info

    Okay so I have found some VBA code that might help me but I am still lost as to how to change it to fit.
    Sub Find_Name()
    Dim Rng As Range
    FindString = InputBox("Enter Entire Employee Name (Last, First):")
    If Trim(FindString) <> "" Then
    With Sheets("Active").Range("B:B")
    Set Rng = .Find(what:=FindString, _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    searchorder:=xlByRows, _
    searchdirection:=xlNext, _
    MatchCase:=False)
    If Not Rng Is Nothing Then
    Application.Goto Rng.Offset(0, -1), True
    Else
    MsgBox "Employee Not Found"
    End If
    End With
    End If
    End Sub

    I have pasted it now with the changes and question I have

    Sub Find_Name()
    Dim Rng As Range
    FindString = HOW DO I ENTER CODE TO ATTACK IT TO THE COMMANDBUTTON I HAVE MADE??
    If Trim(FindString) <> "" Then
    With Sheets("Active").Range("A:A") I have changed this to read A:A cause the into it's searching is in the first row?
    Set Rng = .Find(what:=FindString, _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    searchorder:=xlByRows, _
    searchdirection:=xlNext, _
    MatchCase:=False)
    If Not Rng Is Nothing Then
    Application.Goto Rng.Offset(0, -1), True
    Else
    MsgBox "Employee Not Found"
    End If
    End With
    End If
    End Sub

    I am assuming that I would just fix this code and insert it into a model in VBA mode, I already have a command button built in Forms??

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  2. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  3. Locate max value of one column based on criteria in another colum
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 09:05 AM
  4. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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