Skip to main content

AccessTr.neT


Döngüde Son Satırı Hücre İçin Belirtmek

Döngüde Son Satırı Hücre İçin Belirtmek

#2
(10/01/2020, 17:15)accessman yazdı: iyi günler

LastRow = Sheets("Colors").Cells(Rows.Count, "A").End(xlUp).Row

 For i = 1 To LastRow
            .AddItem Sheets("Colors").Range("B1:B100").Cells(i, 1).Value
            .List(.ListCount - 1, 1) = Sheets("Colors").Range("A1:A100").Cells(i, 1).Value
            .List(.ListCount - 1, 2) = .List(.ListCount - 1, 0) & vbTab & .List(.ListCount - 1, 1)
        Next i


bu kodda döngü lastrow a kadar ama 
Range("B1:B100")
100 de bitiyor bunu nasıl yazacağız mesela şöyle mi olacak
Range("B1:B" & LastRow)
.Range("B1:B100") ve .Range("A1:A100") bu kısımı silin.


For i = 1 To LastRow
            .AddItem Sheets("Colors").Cells(i, 2).Value '2 = B sütunu
            .List(.ListCount - 1, 1) = Sheets("Colors").Cells(i, 1).Value '1=A sütunu
            .List(.ListCount - 1, 2) = .List(.ListCount - 1, 0) & vbTab & .List(.ListCount - 1, 1)
        Next i
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Döngüde Son Satırı Hücre İçin Belirtmek - Yazar: feraz - 08/07/2020, 09:46
Task