+ Reply to Thread
Results 1 to 5 of 5

code to recognize text in a cell and place corresponding info in adjacent cell

  1. #1
    Registered User
    Join Date
    11-17-2013
    Location
    montana
    MS-Off Ver
    Excel 2010
    Posts
    6

    code to recognize text in a cell and place corresponding info in adjacent cell

    I am attempting to make an adjacent cell auto populate with the last name of a police officer when the officers badge number is entered. The number of officers is over 100, and right now the excel spreadsheet is set up with a sheet for each day of the week. What I want to do is find a vba code that I can type in the Badge Number and the Officer name will populate in the next cell over. I know entering all the officers in the code will be a little time consuming, but is not an issue. And If I can't apply it to the entire workbook, but need to put it on each page, that isn't a problem either.

    I attached a copy. But it looks similar to the following:

    Beat Badge Name
    1 346 Gunther
    2 376 Lamantia

    I can't use a function because the number of officers working varies and rows get added and deleted based on the number working on a daily basis and several coworkers use this form, not just me.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: code to recognize text in a cell and place corresponding info in adjacent cell

    maybe Night%20Roster(1).xlsm
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: code to recognize text in a cell and place corresponding info in adjacent cell

    First, you will have to create a master sheet with each officer's name and id numbers, etcetera. The daily roster would be a blank template that could be copied for each day's daily roster and would then use a simple VLookup formula to populate the appropriate cells. You could also make use of Data Validation drop down lists for either the badge or the name. But, you need the master personnel roster.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    11-17-2013
    Location
    montana
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: code to recognize text in a cell and place corresponding info in adjacent cell

    Thank you so much!!!! That worked perfect.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: code to recognize text in a cell and place corresponding info in adjacent cell

    Glad to help. And welcome to the forum.

    If you are satisfied with the solution please mark the thread as [SOLVED] using the thread tools at the top.

    And with any thread you can thank those who have helped you by clicking the * below their post.

+ 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. Formula to identify part of a text in cell from range of cells & insert adjacent cell text
    By Novicebutnotforlong in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-19-2013, 02:11 AM
  2. VBA to validate User Form and Place info in specific cell
    By omartin616 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2013, 10:30 AM
  3. [SOLVED] Formula For - Find value and place value in adjacent cell here
    By CJBeaty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2013, 09:49 PM
  4. [SOLVED] Extract Code from Cell and Place it Adjacent one.
    By Patish in forum Excel General
    Replies: 10
    Last Post: 06-23-2012, 04:43 AM
  5. need a formula or macro to place info in a cell from 2 scanners if they match
    By srollins13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2010, 12:27 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