Results 1 to 4 of 4

Thread: show the colored value of column in listview
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    May 2019
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default show the colored value of column in listview

    hi, everyone

    i have data in sheet1 from range (a:d) , userform contains listview and the column d containes values of colored green and red i would show the colored value of column in list view is there any code do that ?

  2. #2
    MrExcel MVP
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    18,855
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: show the colored value of column in listview

    You can use the ForeColor property of the ListSubItem object to set the font color. For example, the following line will change the font color for the 3rd ListSubItem (3 = Column D) from the first ListItem (1 = Column A), where myCell is a variable that represents a cell...

    Code:
    userform1.ListView1.ListItems(1).ListSubItems(3).ForeColor = myCell.Font.Color
    Hope this helps!

  3. #3
    Board Regular
    Join Date
    May 2019
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: show the colored value of column in listview

    thanks for your replying but where exactly put the code which event?

  4. #4
    MrExcel MVP
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    18,855
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: show the colored value of column in listview

    Presumably, you're using the initialize or activate event with either RowSource or .ListItems.Add and .ListSubItems.Add to add the items to your listview control. So you'll need to adapt it to your code in whichever event you're using.

    If you need help adapting the code, post the code you're using to add the items to your listview control.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •