• DİKKAT

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

Çözüldü Şarta Göre Form Üzerinde Resim Açılması Hakkında..

Katılım
8 Aralık 2011
Mesajlar
964
Excel Vers. ve Dili
Excel 2016,32bit
Merhabalar ,

Oluşturmaya çalıştığım dosyam için bir şey hayal ettim acaba olur mu diye düşünüyorken araştırma yaptığımda userform üzerinde resim çağırma örneklerine rastladım fakat kendime uyarlama konusunda ciddi sorun yaşadım:-(

Düşündüğüm olay şöyle ,
Şİmdi 4 adet butonum var, eğerki ; 1.buton için örnek vermem gerekir ise , R21 hücresindeki değer 100,00% ise butonun yanında OLUMLU resmi çıksın.
Ben ekteki dosyamda manuel olarak yerleştirmiştim. Açıklamaları da yapmıştım.
 

Ekli dosyalar

  • DENEME.xlsm
    DENEME.xlsm
    253.5 KB · Görüntüleme: 6
  • OLUMLU.jpg
    OLUMLU.jpg
    7.2 KB · Görüntüleme: 3
  • OLUMSUZ.jpg
    OLUMSUZ.jpg
    57.9 KB · Görüntüleme: 2
Dosyanız ektedir. :cool:

Kod:
Private Sub UserForm_Initialize()
Dim arr, i As Byte
arr = Array("", 21, 30, 31, 32)
For i = 1 To 4
    Me.Controls("image" & arr(i)).Visible = False
Next i
If Range("R21").Value = 1 Then Image29.Visible = False: Image21.Visible = True
If Range("S21").Value = 1 Then Image25.Visible = False: Image30.Visible = True
If Range("T21").Value = 1 Then Image27.Visible = False: Image31.Visible = True
If Range("U21").Value = 1 Then Image28.Visible = False: Image32.Visible = True
End Sub
 

Ekli dosyalar

Sayın Orion, Harika olmuş yaaa:oops:(y) Ay çok mutlu oldum gerçekten yaa, çok teşekkür ederim.:)
 
Sayın Orion merhabalar,

2 nolu mesajınızda yapmış olduğunuz kodları kendime aşağıdaki şekliyle uyarladım.


Kod:
Private Sub UserForm_Initialize()
Dim arr, i As Byte

With ListView1
    .View = lvwReport  'ListView de buna dikkat etmeliyiz, Eğer ListWiev de burayı lvwReport olarak ayarlamazsak diğer yapılan işlemler listemizde gözükmeyecektir.
     .ColumnHeaders.Add , , "MARKER ", 50
     .ColumnHeaders.Add , , "ALEL1", 35, 2
     .ColumnHeaders.Add , , "ALEL2", 40, 2
      .ColumnHeaders.Add , , "ALEL1", 40, 2
       .ColumnHeaders.Add , , "ALEL2", 40, 2
        .ColumnHeaders.Add , , "ALEL1", 40, 2
         .ColumnHeaders.Add , , "ALEL2", 40, 2
         .ColumnHeaders.Add , , " ", 20, 2
         .ColumnHeaders.Add , , "BABA EŞLEŞEN", 65, 2
         .ColumnHeaders.Add , , "DOMINANT GEN", 70, 2
         .ColumnHeaders.Add , , "P.INDEX", 50, 2
          .ColumnHeaders.Add , , "DIŞLAMA", 60, 2
          
    
    
    
   .FullRowSelect = True 'liste elemanını seçtiğinizde tüm satır seçili olur.
   .Gridlines = True 'Listeyi çizgili yapar.
End With

arr = Array("", 39, 38, 21)
For i = 1 To 3
    Me.Controls("image" & arr(i)).Visible = False
Next i
If Sheets("DIŞLAMA").Range("B20").Value = "" Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
If Sheets("DIŞLAMA").Range("F20").Value = "" Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
If Sheets("DIŞLAMA").Range("J20").Value = "" Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = True

If Sheets("DIŞLAMA").Range("B20").Value = 1 Then Image30.Visible = True: Image37.Visible = False: Image39.Visible = False
If Sheets("DIŞLAMA").Range("F20").Value = 1 Then Image40.Visible = True: Image29.Visible = False: Image38.Visible = False
If Sheets("DIŞLAMA").Range("J20").Value = 1 Then Image41.Visible = True: Image35.Visible = False: Image21.Visible = False

If Sheets("DIŞLAMA").Range("B20").Value = 2 Then Image30.Visible = True: Image37.Visible = False: Image39.Visible = False
If Sheets("DIŞLAMA").Range("F20").Value = 2 Then Image40.Visible = True: Image29.Visible = False: Image38.Visible = False
If Sheets("DIŞLAMA").Range("J20").Value = 2 Then Image41.Visible = True: Image35.Visible = False: Image21.Visible = False

If Sheets("DIŞLAMA").Range("B20").Value > 3 Then Image30.Visible = False: Image37.Visible = True: Image39.Visible = False
If Sheets("DIŞLAMA").Range("F20").Value > 3 Then Image40.Visible = False: Image29.Visible = True: Image38.Visible = False
If Sheets("DIŞLAMA").Range("J20").Value > 3 Then Image41.Visible = False: Image35.Visible = True: Image21.Visible = False

If Sheets("DIŞLAMA").Range("B22").Value = 15 Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = False
If Sheets("DIŞLAMA").Range("F22").Value = 15 Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = False
If Sheets("DIŞLAMA").Range("J22").Value = 15 Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = False

End Sub

DIŞLAMA sayfasındaki belirtilen hücrelere manuel olarak değer yazdığımda kodlar çok güzel şekilde çalışmakta, fakat kodlarda ki hücreye şu formül ile değer aldığımda çalışmıyor.
Kod:
=EĞER(TOPLA.ÇARPIM(($B$3:$B$17<>"")*($B$3:$B$17<>0))=0;"";TOPLA.ÇARPIM(($B$3:$B$17<>"")*($B$3:$B$17<>0))&"")

Nerede yanlış yapıyorum acaba:unsure:
 
Küçük bir sorun var ama anlayamadım.:unsure:
DIŞLAMA sayfasındaki belirtilen hücrelere manuel olarak değer yazdığımda kodlar çok güzel şekilde çalışmakta, fakat kodlarda ki hücreye şu formül ile değer aldığımda çalışmıyor.
 

Ekli dosyalar

Formül yerine şöyle bir şey yapılabilir mi?
Private Sub UserForm_Initialize()
Kodlarım 5 nolu mesaj da mevcut olduğu gibidir.

Acaba ;
Kod:
If Sheets("DIŞLAMA").Range("B20").Value = "" Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
If Sheets("DIŞLAMA").Range("F20").Value = "" Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
If Sheets("DIŞLAMA").Range("J20").Value = "" Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = True

Buradaki B20 yerine ; B3:B17 içerisinde dolu hücre yok ise diye olsa, ben formüllerden kurtulmuş olurum diye düşündüm kendimce:unsure: Olur ise diğer kısımları da ona göre düzenlerim.
 
deneyiniz.:cool:
Kod:
If WorksheetFunction.CountA(Range("B3:B17")) = 0 Then
    Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
    Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
    Image41.Visible = False: Image35.Visible = False: Image21.Visible = True
End If
 
Sayın Orıon merhabalar:giggle:

8 nolu mesajınızdaki kod bloğunu çoğaltmak istedim ama resimleri değiştiremedim. Yani hazırladığınız kodlarda B3:B17 arasında 0 dolu hücre var ise evet resimler ona göre değişti, lakin bende bu kodlara bakarak, 1 olursa , 2 olursa v.s. gibi çoğaltmak istemiştim. :unsure:
 
Sayın Orıon merhabalar:giggle:

8 nolu mesajınızdaki kod bloğunu çoğaltmak istedim ama resimleri değiştiremedim. Yani hazırladığınız kodlarda B3:B17 arasında 0 dolu hücre var ise evet resimler ona göre değişti, lakin bende bu kodlara bakarak, 1 olursa , 2 olursa v.s. gibi çoğaltmak istemiştim. :unsure:
B3 B4 ve B5 için yaptım.Size bir fikir verebilir.:cool:
Kod:
    If Range("B3").Value = 1 Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
    If Range("B4").Value = 2 Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
    If Range("B5").Value = 3 Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = True
 
Kod:
 If Range("B3").Value = 1 Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
    If Range("B4").Value = 2 Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
    If Range("B5").Value = 3 Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = True

Sayın orıon, buradaki kodlarda B3 'ün değeri 1 olur ise evet, lakin benim demek istediğim şöyle idi;

Eğer ki , B3:B17 içerisindeki dolu hücreler sayılsın, ve o sayıya göre değerlendirmek istemekteyim. Yani dolu hücre sayısını şart almam gerekiyor. Yani bu aralık içerisindeki dolu hücreleri sayıp eğer 1 tane dolu var ise, 0 dolu var ise v.s. diye çoğaltmak istiyorum.:giggle:
 
Kod:
 If Range("B3").Value = 1 Then Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
    If Range("B4").Value = 2 Then Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
    If Range("B5").Value = 3 Then Image41.Visible = False: Image35.Visible = False: Image21.Visible = True

Sayın orıon, buradaki kodlarda B3 'ün değeri 1 olur ise evet, lakin benim demek istediğim şöyle idi;

Eğer ki , B3:B17 içerisindeki dolu hücreler sayılsın, ve o sayıya göre değerlendirmek istemekteyim. Yani dolu hücre sayısını şart almam gerekiyor. Yani bu aralık içerisindeki dolu hücreleri sayıp eğer 1 tane dolu var ise, 0 dolu var ise v.s. diye çoğaltmak istiyorum.:giggle:
Böylemi?
Kod:
Dim say As Long
say = Application.WorksheetFunction.CountA(Range("B3:B17"))
If say = 1 Then
    Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
End If
If say = 2 Then
    Image40.Visible = False: Image29.Visible = False: Image38.Visible = True
End If
If say = 3 Then
   Image41.Visible = False: Image35.Visible = False: Image21.Visible = True
End If
 
Evet Sanırım böyle olacak, Sayın Orıon..
Fakat "Private Sub UserForm_Initialize() " kodlarına tam olarak nasıl yapıştırdım gerekiyor:unsure: Yaptım ama olmadı:-(

Bu şeklide yapmıştım ben,
Kod:
arr = Array("", 39, 38, 21)
For i = 1 To 3
    Me.Controls("image" & arr(i)).Visible = False
Next i

Dim say As Long
say = Application.WorksheetFunction.CountA(Range("B3:B17"))
If say = 1 Then
    Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
End If
If say = 2 Then
    Image40.Visible = False: Image29.Visible = False: Image38.Visible = False
End If
If say = 3 Then
   Image41.Visible = True: Image35.Visible = False: Image21.Visible = False
End If

End Sub
 
Initialize sadece form açılırken çalışır.
 
Hmm, aslında bende form açıldığında olsun istiyorum:unsure:
Formu açtığımda, DIŞLAMA sayfasındaki B3:B17 arasındaki dolu hücreler sayılsın ona göre ilgili resimler çıksın.
 
Hmm, aslında bende form açıldığında olsun istiyorum:unsure:
Formu açtığımda, DIŞLAMA sayfasındaki B3:B17 arasındaki dolu hücreler sayılsın ona göre ilgili resimler çıksın.
Aşağıdaki olaya yapıştırın.:cool:
Kod:
Private Sub UserForm_Initialize()
 
Kod:
Private Sub UserForm_Initialize()
Dim arr, i As Byte

With ListView1
    .View = lvwReport  'ListView de buna dikkat etmeliyiz, Eğer ListWiev de burayı lvwReport olarak ayarlamazsak diğer yapılan işlemler listemizde gözükmeyecektir.
     .ColumnHeaders.Add , , "MARKER ", 50
     .ColumnHeaders.Add , , "ALEL1", 35, 2
     .ColumnHeaders.Add , , "ALEL2", 40, 2
      .ColumnHeaders.Add , , "ALEL1", 40, 2
       .ColumnHeaders.Add , , "ALEL2", 40, 2
        .ColumnHeaders.Add , , "ALEL1", 40, 2
         .ColumnHeaders.Add , , "ALEL2", 40, 2
         .ColumnHeaders.Add , , " ", 20, 2
         .ColumnHeaders.Add , , "BABA EŞLEŞEN", 65, 2
         .ColumnHeaders.Add , , "DOMINANT GEN", 70, 2
         .ColumnHeaders.Add , , "P.INDEX", 50, 2
          .ColumnHeaders.Add , , "DIŞLAMA", 60, 2
          
    
    
    
   .FullRowSelect = True 'liste elemanını seçtiğinizde tüm satır seçili olur.
   .Gridlines = True 'Listeyi çizgili yapar.
End With

arr = Array("", 39, 38, 21)
For i = 1 To 3
    Me.Controls("image" & arr(i)).Visible = False
Next i

Dim say As Long
say = Application.WorksheetFunction.CountA(Range("B3:B17"))
If say = 1 Then
    Image30.Visible = False: Image37.Visible = False: Image39.Visible = True
End If
If say = 2 Then
    Image40.Visible = False: Image29.Visible = False: Image38.Visible = False
End If
If say = 3 Then
   Image41.Visible = True: Image35.Visible = False: Image21.Visible = False
End If

End Sub

Bu şekilde yapmıştım ama olmadı:unsure:
 
say değişkeni hangi sayfadan alıyorsa o sayfayıda range nin önüne yazıpta deneyiniz.:cool:
 
Kod:
say = Application.WorksheetFunction.CountA(Sheets("DIŞLAMA").Range("B3:B17"))

Bu şekilde yaptım:unsure: Olmadı:rolleyes:
 
Kod:
say = Application.WorksheetFunction.CountA(Sheets("DIŞLAMA").Range("B3:B17"))

Bu şekilde yaptım:unsure: Olmadı:rolleyes:
Aşağıdaki kodda hepsi false.
Kod:
If say = 2 Then
    Image40.Visible = False: Image29.Visible = False: Image38.Visible = False
End If
 
Geri
Üst