+ Reply to Thread
Results 1 to 3 of 3

Colour items in Userform Listbox

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Colour items in Userform Listbox

    Hi,

    I have a userform which displays negative values from cells. I want each value (Listbox item) to be coloured with red, If value of cell is lower than "-200:00".

    I searched a lot and found that It probaly can't be done in Listbox control, but found that maybe It can work with Listview control (according to Charlize's code from forums).

    I tried that too, but just can't figure out how to fix a code that would work for me

    This is a code for listbox :

    Please Login or Register  to view this content.
    ...And I've attached a listview control and copied Charlize's code into Userform (and commented It), but cannot fix It.


    Could someone please let me know If It's possible to solve this problem with any of these ways, or other

    See attached sample !!
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Colour items in Userform Listbox

    Maybe.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Colour items in Userform Listbox

    Perfect, It works

    Can I have only two ColumnHeaders to display or must I change width of control, now I see third ColumnHeader too !

    Tried wiith ColumnHeaders.Count=2, but not working !

  4. #4
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Colour items in Userform Listbox

    Perfect, It works

    Can I have only two ColumnHeaders to display or must I change width of control, now I see third ColumnHeader too !

    Tried wiith ColumnHeaders.Count=2, but not working !

  5. #5
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Colour items in Userform Listbox

    I just resized Listview, It doesn't matter, thanks for your code !!!

+ 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] Add Selected Items From One ListBox to Another ListBox on UserForm
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 06:53 PM
  2. VBA edit listbox items on userform
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 03:51 AM
  3. loading ListBox row items to another UserForm
    By StartingOut in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-27-2012, 10:37 AM
  4. Transfer Selected UserForm ListBox Items into a new Row
    By oumomof3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2011, 02:02 PM
  5. Different colour of font for various items in ListBox!
    By Riorin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2008, 04:42 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