+ Reply to Thread
Results 1 to 4 of 4

ListBox highlight

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    Australia
    MS-Off Ver
    2003,2007
    Posts
    2

    ListBox highlight

    Hi Everyone,

    Currently working with a booking system and having difficulty with the highlight/selector function within a listbox (selecting time).

    I did not code the system but am trying to work through errors.

    There is a time based listbox (8:00 -17:00) which is used for bookings. A formula is linked to the listbox which indicates how many rooms are available at the selected time.


    The issue is the below code. The first time selected on the list will highlight, if you click on another time the system and formula recognise it but it will not highlight. The original time stays highlighted.

    If I remove the below code the new time will highlight but the formula for available rooms stops working.

    '==========================================================================================================
    ' ## BookingTime_Click
    ' used to trap a click on the BookingTime Listbox control & update the available rooms
    '==========================================================================================================
    Private Sub BookingTime_Click()

    Call UpdateAvailableRooms

    End Sub



    Can someone please help with this?
    Last edited by Gokz777; 11-24-2014 at 11:30 PM.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: ListBox highlight

    We would need to see all the code, not just this one segment.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    11-07-2014
    Location
    Australia
    MS-Off Ver
    2003,2007
    Posts
    2

    Re: ListBox highlight

    Quote Originally Posted by natefarm View Post
    We would need to see all the code, not just this one segment.
    Please Login or Register  to view this content.
    Last edited by Gokz777; 11-25-2014 at 08:26 PM.

  4. #4
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: ListBox highlight

    I should have said this before. Please always wrap code in code tags when posting. Please edit your posts above accordingly.

    One issue I see (not that it's causing your problem) is that you are calling the UpdateAvailableRooms subroutine, but UpdateAvailableRooms is set up as a function. It may have just been a typo, or may indicate a lack of understanding of the difference between the two. Functions should return a value, like GetAvailableRooms. Which brings up the next problem. The GetAvailableRooms subroutine is missing from the code provided, so further evaluation isn't possible.

    I'm taking off for the Thanksgiving weekend, so if someone else wants to jump in after Gokz777 responds, be my guest.

+ 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. [SOLVED] Listbox Selection/Highlight is lost after changing Listbox BackColor
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 10:43 PM
  2. how to auto highlight listbox
    By Quicksnot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2013, 04:32 PM
  3. Highlight All in Listbox
    By danderson2692 in forum Excel General
    Replies: 6
    Last Post: 07-16-2012, 05:22 PM
  4. Listbox Highlight selection
    By cd in forum Excel General
    Replies: 1
    Last Post: 11-30-2005, 03:10 PM
  5. Listbox-have the user highlight
    By Greg B in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-16-2005, 11: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