Nader
03-21-2008, 07:37 AM
I have a microsoft control lisview 6.0
And I use this way to load the items in the sheets1 to the listview
For i = 10 To Sheets(1).UsedRange.Rows.Count
Set itmAdd = ListView1.ListItems.Add(Text:= Sheets(1).Range("A" & i).Value)
itmAdd.SubItems(1) = Sheets(1).Range("B" & i).Value
I want a code to load only the item with this condition
If cells(i,1).value= S and cells(i,2).value= 7
Load the item in blue ..as it show in the pic
And I use this way to load the items in the sheets1 to the listview
For i = 10 To Sheets(1).UsedRange.Rows.Count
Set itmAdd = ListView1.ListItems.Add(Text:= Sheets(1).Range("A" & i).Value)
itmAdd.SubItems(1) = Sheets(1).Range("B" & i).Value
I want a code to load only the item with this condition
If cells(i,1).value= S and cells(i,2).value= 7
Load the item in blue ..as it show in the pic