show the colored value of column in listview

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,494
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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 ?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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!
 
Upvote 0
thanks for your replying but where exactly put the code which event?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top