• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Find Komutu ile dolu hücreleri bulma problemi

Katılım
5 Ocak 2009
Mesajlar
1,586
Excel Vers. ve Dili
2003 Türkçe
Selam,
aşağıdaki kodlar ile B sütunundaki belirlediğim aralıktaki dolu hücreleri buluyorum. Ancak, B6 dolu ise, B6'yı en son olarak msgbox'ta gösteriyor. diğerlerini sırayla gösteriyor.

eğer ("B5:B" & son_B) olarak yazarsam bu sefer B5'te bulunan sütun başlığını buluyor.
Kırmızı alana ne yazmalıyım ki Msgbox'ta dolu satırları sırayla göstersin?

Yardımcı olabilirseniz sevinirim.
İyi çalışmlar.



Kod:
Sub do_ornek()
Dim plan As Worksheet
Dim son_B As Long
Dim bulunan As Range
Set plan = ThisWorkbook.Sheets("sayfa1")

son_B = plan.Range("B65536").End(3).Row

[COLOR="Red"]Set bulunan = plan.Range("B6:B" & son_B).Find(What:="*", LookIn:=xlValues)[/COLOR]
If Not bulunan Is Nothing Then

ilkadres = bulunan.Address
Do
MsgBox bulunan.Row

Set bulunan = plan.Range("B6:B" & son_B).FindNext(bulunan)
Loop While Not bulunan Is Nothing And bulunan.Address <> ilkadres

End If
End Sub
 
Merhaba,

Kırmızı yerleri inceleyiniz.

Kod:
Sub do_ornek()
Dim plan As Worksheet
Dim son_B As Long
Dim bulunan As Range
[B][COLOR=red]Dim ilkadres As String
[/COLOR][/B]
Set plan = ThisWorkbook.Sheets("sayfa1")
son_B = plan.Range("B65536").End(3).Row
Set bulunan = plan.Range("[B][COLOR=red]B5[/COLOR][/B]:B" & son_B).Find(What:="*", LookIn:=xlValues)
If Not bulunan Is Nothing Then
    ilkadres = bulunan.Address
    Do
        [COLOR=red][B]If bulunan.Row > 5[/B][/COLOR] Then MsgBox bulunan.Row
    Set bulunan = plan.Range("B6:B" & son_B).FindNext(bulunan)
    Loop While Not bulunan Is Nothing And bulunan.Address <> ilkadres
End If
End Sub
 
Merhaba,

Kırmızı yerleri inceleyiniz.

Kod:
Sub do_ornek()
Dim plan As Worksheet
Dim son_B As Long
Dim bulunan As Range
[B][COLOR=red]Dim ilkadres As String
[/COLOR][/B]
Set plan = ThisWorkbook.Sheets("sayfa1")
son_B = plan.Range("B65536").End(3).Row
Set bulunan = plan.Range("[B][COLOR=red]B5[/COLOR][/B]:B" & son_B).Find(What:="*", LookIn:=xlValues)
If Not bulunan Is Nothing Then
    ilkadres = bulunan.Address
    Do
        [COLOR=red][B]If bulunan.Row > 5[/B][/COLOR] Then MsgBox bulunan.Row
    Set bulunan = plan.Range("B6:B" & son_B).FindNext(bulunan)
    Loop While Not bulunan Is Nothing And bulunan.Address <> ilkadres
End If
End Sub

hocam Çok teşekkür ederim. ellerinize sağlık.
 
Geri
Üst