• DİKKAT

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

İki IF'i tek bir IF te birleştirme

  • Konbuyu başlatan Konbuyu başlatan crion
  • Başlangıç tarihi Başlangıç tarihi
Katılım
20 Ekim 2011
Mesajlar
60
Excel Vers. ve Dili
Excel 2010
Selamlar, bir küçük sorunum var yardımcı olabilirseniz sevinirim.

Kod:
If (Left(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)   'isim hızlı arama
If (Right(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)   'soyad hızlı arama

bu iki kod ayrı ayrı doğru çalışıyorlar ancak iki adet girdi yaratıyorlar ListBox1 içinde, o yüzden bu iki if'i tek if'te birleştirmem lazım, sanırım başına bir OR koymam gerekli ancak fazla komplike geldiği için içinden çıkamadım, yardımcı olabilir misiniz?
 
Böyle denermisiniz.?

Kod:
If (Left(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) [COLOR=red][B]And[/B][/COLOR] (Right(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)

yada böyle

Kod:
If (Left(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) [COLOR=red][B]Or[/B][/COLOR] (Right(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)
 
Böyle denermisiniz.?

Kod:
If (Left(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) [COLOR=red][B]And[/B][/COLOR] (Right(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)

yada böyle

Kod:
If (Left(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) [COLOR=red][B]Or[/B][/COLOR] (Right(LCase(MyRange), Len(ComboBox2)) = LCase(ComboBox2)) Then ListBox1.AddItem (MyRange)

teşekkürler çalışıyor.
 
Geri
Üst