+ Reply to Thread
Results 1 to 4 of 4

Change back color of List Box dependent on value.

  1. #1
    Registered User
    Join Date
    11-19-2007
    Posts
    22

    Change back color of List Box dependent on value.

    Help!

    I have 2 variables which import into a listbox from an excel page.

    I would like the background colour to change dependent on the text in the Listbox.

    The two variables are Gain and loss.

    If the word gain appears in the listbox I would like the back ground colour to be Green
    and if the word loss appears in the listbox I would like the background colour to be red.

    I am very rusty with VBA and am struggling to make this happen.

    My feeble attempt so far is as follows:

    Please Login or Register  to view this content.
    Any ideas?

    Thank you in advance.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Change back color of List Box dependent on value.

    why are you using a listbox if it only contains one of two values?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    11-19-2007
    Posts
    22

    Re: Change back color of List Box dependent on value.

    Again this is my poor knowledge. If there is a better way to display data on the userform I am all ears!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Change back color of List Box dependent on value.

    perhaps a textbox? kinda guessing here as I've got no context to work with ;-)

+ 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. Change Cell Value Dependent Upon List Box
    By CKRebel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2012, 03:06 PM
  2. change cell back color in small array
    By nigelshaw in forum Excel General
    Replies: 1
    Last Post: 03-01-2012, 07:58 PM
  3. Change the Back Ground Color on basis of content of cell in a range
    By ravinder_tigh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2009, 11:36 PM
  4. IF 3 cells = (biggest value) then (change back fill color)
    By Nik_AU in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-24-2007, 04:02 AM
  5. Change cell back color on click
    By MaT in forum Excel General
    Replies: 4
    Last Post: 01-24-2005, 07:06 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