• DİKKAT

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

MsgBox ve InputBox la seçim

Katılım
8 Haziran 2007
Mesajlar
401
Excel Vers. ve Dili
excel fonksiyonlar
Forumda emeği geçen herkese merhaba. Arkadaşlar sanırım aşağıdaki kodların müdahaleye ihtiyacı var. Yapmak istediğim Döngünün sonunda MsgBox da Evet e tıkladığımda inputbox görünsün ve yazdığım değeri K sütununa yazsın. Hayıra tıkladığımda da sub dan çıksın. Bu kodlar iki seçenekte de seçimi K sütununa giriyor. Yardımı olur diye kodun tamamını daha alta ekliyorum.

a = MsgBox("SEÇİM YAPMAK İSTERMİSİNİZ ? ", vbYesNo)
If a = vbYes Then
seçim = InputBox("seçim giriniz")
.Cells(i, "K") = seçim
Else
Exit Sub
End If



With syf2
bul = ListBox4.Column(6)

If WorksheetFunction.CountIf(syf2.Range("E6:E15"), bul) >= 1 Then
MsgBox "MÜKERRER KAYIT GİRDİNİZ"
Exit Sub
End If

For i = 6 To 15
If syf2.Cells(i, "B") = "" Then
.Cells(i, "B") = ListBox4.Column(2)
.Cells(i, "C") = ListBox4.Column(3)
.Cells(i, "D") = ListBox4.Column(5)
.Cells(i, "E") = ListBox4.Column(6)
.Cells(i, "F") = ListBox4.Column(7)
.Cells(i, "G") = ListBox4.Column(8)
.Cells(i, "H") = ListBox4.Column(9)
.Cells(i, "I") = ListBox4.Column(10)
.Cells(i, "J") = ListBox4.Column(11)
a = MsgBox("SEÇİM YAPMAK İSTERMİSİNİZ ? ", vbYesNo)
If a = vbYes Then
seçim = InputBox("seçim giriniz")
.Cells(i, "K") = seçim
Else
Exit Sub
End If



End If
Next

End With
 
Merhaba,

Sorunuz net değil. Anladığım;

Kod:
With syf2
 
    bul = ListBox4.Column(6)
    If WorksheetFunction.CountIf(syf2.Range("E6:E15"), bul) >= 1 Then
        MsgBox "MÜKERRER KAYIT GİRDİNİZ"
        Exit Sub
    End If
 
    For i = 6 To 15
        If syf2.Cells(i, "B") = "" Then
            .Cells(i, "B") = ListBox4.Column(2)
            .Cells(i, "C") = ListBox4.Column(3)
            .Cells(i, "D") = ListBox4.Column(5)
            .Cells(i, "E") = ListBox4.Column(6)
            .Cells(i, "F") = ListBox4.Column(7)
            .Cells(i, "G") = ListBox4.Column(8)
            .Cells(i, "H") = ListBox4.Column(9)
            .Cells(i, "I") = ListBox4.Column(10)
            .Cells(i, "J") = ListBox4.Column(11)
        End If
    Next i
 
    a = MsgBox("SEÇİM YAPMAK İSTERMİSİNİZ ? ", vbYesNo)
    If a = vbYes Then
    seçim = InputBox("seçim giriniz")
        .Cells(i, "K") = seçim
    End If
 
End With
.
 
Geri
Üst