teknikyapı
Altın Üye
- Katılım
- 30 Nisan 2007
- Mesajlar
- 396
- Excel Vers. ve Dili
- Office 365
- Altın Üyelik Bitiş Tarihi
- 13-01-2026
Merhaba.Aşağıdaki kodlarda hücrenin başında (*) işareti olan verileri listview alırken renklendiriyor.Fakat kırmızı yazılı kod hatalı çalışıyor.Yardımcı olacak arkadaşlara şimdiden teşekkür ederim.İyi çalışmalar.
With ListView1
For i = 2 To c
x = x + 1
.ListItems.Add , , Cells(i + 1, 1)
.ListItems(x).SubItems(1) = Cells(i + 1, 2)
.ListItems(x).SubItems(2) = Cells(i + 1, 3)
.ListItems(x).SubItems(3) = Cells(i + 1, 4)
.ListItems(x).SubItems(4) = Cells(i + 1, 5)
.ListItems(x).SubItems(5) = Cells(i + 1, 6)
'eğer hücre başında (*) işareti var ise satırı kırmızı renklendir
If Left(Cells(i + 1, 2), 1) = "*" Then
.ListItems(x).ListSubItems(1).ForeColor = vbRed' 2.kolon renkleniyor
.ListItems.Add.ForeColor = vbRed' bu kolon renklenmiyor
End If
Next
End With
With ListView1
For i = 2 To c
x = x + 1
.ListItems.Add , , Cells(i + 1, 1)
.ListItems(x).SubItems(1) = Cells(i + 1, 2)
.ListItems(x).SubItems(2) = Cells(i + 1, 3)
.ListItems(x).SubItems(3) = Cells(i + 1, 4)
.ListItems(x).SubItems(4) = Cells(i + 1, 5)
.ListItems(x).SubItems(5) = Cells(i + 1, 6)
'eğer hücre başında (*) işareti var ise satırı kırmızı renklendir
If Left(Cells(i + 1, 2), 1) = "*" Then
.ListItems(x).ListSubItems(1).ForeColor = vbRed' 2.kolon renkleniyor
.ListItems.Add.ForeColor = vbRed' bu kolon renklenmiyor
End If
Next
End With