+ Reply to Thread
Results 1 to 5 of 5

How do I auto populate a cell from a searched result

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    How do I auto populate a cell from a searched result

    Hi All,

    I have a time schedule that auto populates when you change the date from a list of jobs on a separate tab. I currently have it setup to display the word "allocated" but ideally I want 3/4 of the fields from that job to populate the cell/s. At the same time, ideally I would like it to change colour depending on the status (as in the jobs tab) but also for those cells to auto merge and then unmerge when the date is changed.

    I know this is a lot to ask but if some one can help with some or all of it I would be greatly thankful. I'm officially stuck!!!!!!!!

    Drivers Schedule.xlsx

    Many Thanks

    Wayne

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: How do I auto populate a cell from a searched result

    Hello Wayne,

    looks familiar !!

    What you need to do is change "allocated" in the formula to a term which will return the fields that you want, concatenated together. For example, if you want to return the Customer name and the Location, separated by a comma-space, then you could use this to replace "allocated" (including the quotes):

    INDEX(Jobs!$A:$A,MATCH(D$4&"*",Jobs!$K:$K,0))&", "&INDEX(Jobs!$B:$B,MATCH(D$4&"*",Jobs!$K:$K,0))

    so that the formula in D5 would now become:

    =IF(ISNA(MATCH(D$4&"*",Jobs!$K:$K,0)),"",IF(AND($C5>=VALUE(MID(INDEX(Jobs!$K:$K,MATCH(D$4&"*",Jobs!$K:$K,0)),FIND("_",INDEX(Jobs!$K:$K,MATCH(D$4&"*",Jobs!$K:$K,0)))+1,5)&":00"),$C5<=VALUE(MID(INDEX(Jobs!$K:$K,MATCH(D$4&"*",Jobs!$K:$K,0)),FIND("|",INDEX(Jobs!$K:$K,MATCH(D$4&"*",Jobs!$K:$K,0)))+1,5)&":00")),INDEX(Jobs!$A:$A,MATCH(D$4&"*",Jobs!$K:$K,0))&", "&INDEX(Jobs!$B:$B,MATCH(D$4&"*",Jobs!$K:$K,0)),""))

    This can be copied across and down your table.

    Hopefully you can see how to amend that term to allow you to bring other fields of data across - you will need to widen the columns in your table.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How do I auto populate a cell from a searched result

    Thanks again Pete, this helps and makes sense.....

    Im not sure if the merging part can be done or not so that I only have one "box" for each job rather than "10 lines" if that makes sense??!!

    Thanks again

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: How do I auto populate a cell from a searched result

    A formula couldn't do the merging, and there is a formula in the next cell anyway which will be lost if you did try to merge the cells (manually or with VBA). It doesn't help, also, that you have added 5 minute increments to the file instead of 15, so now you have 3 times as many formulae - are your drivers (and traffic around your way) predictable to 5 minutes??

    You could possibly achieve something like you want by applying conditional formatting, such that if a cell is not empty AND is the same as the previous one then use a background colour and foreground colour the same, so that they appear empty but are the same colour as the first cell in a block.

    Hope this helps.

    Pete

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: How do I auto populate a cell from a searched result

    Hi Wayne,

    I carried on with this yesterday but then forgot to post it. I've set this up using the same colours as in your status column, and have brought the first 4 characters of status to control the conditional formatting - now you get blocks of colour and only the first row of data is visible (the other rows are there, they are just "hidden" by using the same foreground and background colours). I've changed some of the status values so that you can see 4 of them.

    Hope this helps.

    Pete
    Attached Files Attached Files

+ 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. Replies: 9
    Last Post: 03-07-2012, 02:34 PM
  2. Replies: 3
    Last Post: 02-28-2012, 11:54 AM
  3. Populate result in different cell when selecting from drop down list
    By techfashion in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2011, 02:10 PM
  4. Auto filter multiple columns matching with searched headers
    By gotovamsee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2011, 03:20 PM
  5. Using a button to add a counter value to the searched result
    By exlnb2008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2008, 10:41 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