+ Reply to Thread
Results 1 to 8 of 8

Listbox - as time slots for given date accepted, remove those times from listbox

  1. #1
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Listbox - as time slots for given date accepted, remove those times from listbox

    I'd like to have a listbox displaying times from 8am to 6pm with say 15 min intervals, these are allocated against a date in an adjoining column.
    As the times are allocated I'd like them to not be visible in the remaining list.

    I can create listboxes but don't know how to achieve the above.
    Thanks for helping.

  2. #2
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    One approach may be to use a helper column... List the available time slots in one column, then create another which lists distinct values.

    Then use the helper column to populate the dropdown list in the datavalidation.

    Does this do it for you?

    Tim
    Never stop learning!
    <--- please consider *-ing !

  3. #3
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    Hi Tim,

    Thanks very much for replying.
    Your solution does work. Is there a way to eliminate the helper columns ?

    Even a vba solution maybe ?

  4. #4
    Valued Forum Contributor
    Join Date
    06-22-2018
    Location
    Blackpool, England
    MS-Off Ver
    2019
    Posts
    408

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    You could do this in VBA and trigger it in the Worksheet_Change() event...
    Please Login or Register  to view this content.
    Tim

  5. #5
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    Hi Tim,
    Thanks for the macro example, which works wonderfully in your example.

    I've just realised on viewing your example that I omitted some info in my original request for help. I've attached a sample sheet to show what I mean.
    In sheet "N Status" Col K are dates, for each date I'd like to have the full range of available appt times, some or all could be allocated. The appt times reside in sheet "Setup" col D.

    Once again, thank you for your continued help.
    Attached Files Attached Files

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    Hi sipa,
    there has to be some logic - although I fail to grasp it - why are the dates haphazardly randomly placed with gaps and no chronological order.
    Given the above how and where do you decide to place your entry, this needs answering before any attempt is made to combine date with time.
    torachan.

  7. #7
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    Hi Torachan,

    Thanks for your interest.
    The blanks in Col K & L on sheet "N Status" are there because no appt has been set for that row, those that are not blank are to show what it should look like when an appt has been set.
    Dates are in random order just because that is how our system is designed, this cannot be changed.

    We allocate a date first then set a time.

    Hope that explanation is of some help.
    sipa

  8. #8
    Forum Contributor
    Join Date
    06-10-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    272

    Re: Listbox - as time slots for given date accepted, remove those times from listbox

    I'm hoping someone might pick this up and try to help me with a solution.

    I've attached an updated sample file with some notes within to try and clearly explain what I'm looking for. I know the random nature of the date order looks odd, but believe me that is how it should be.

    Thanks for looking.
    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: 0
    Last Post: 05-06-2019, 03:36 PM
  2. Selection in a userform listbox is not accepted
    By Enzo Leoni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2018, 07:20 PM
  3. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  4. Multicolumn dynamic Listbox - Remove Duplicates in Listbox
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2014, 12:30 PM
  5. [SOLVED] Displaying date and time format in Listbox
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2013, 09:26 AM
  6. userform listbox
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2013, 11:09 PM
  7. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM

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