- Katılım
- 29 Aralık 2007
- Mesajlar
- 40
- Excel Vers. ve Dili
- 2010-türkçe
Selam arkadaşlar;
Userform da ListBox1 oluşturup içerisindeki verileri sayfa1'e aktarıp, ListBox1 i temizleyip, çalışma kitabını aşağıdaki kod ile kaydediyorum.
Private Sub CommandButton1_Click()
Dim i As Long, s As Long, a As Long
s = Sayfa1.Range("a65536").End(3).Row
For i = 1 To 5
For a = 0 To ListBox1.ListCount - 1
Sayfa1.Cells(s + a + 1, i).Value = ListBox1.List(a, i - 1)
Next a
Next i
MsgBox "Sonuçlar aktarılmıştır.", vbInformation, "İşlem Tamam - YaVuZ"
ListBox1.Clear
Application.ScreenUpdating = False
If MsgBox("YAPILAN İŞLEMLERİ KAYDETMEK İSTİYORMUSUNUZ?", vbYesNo + vbQuestion, "KAYDET") = vbYes Then
ThisWorkbook.Save
MsgBox "YAPILAN İŞLEMLER KAYDEDİLDİ.", vbInformation, " KAYIT - YaVuZ"
Else
Exit Sub
End If
Call TextBox1_Enter
End Sub
Aşağıdaki kod ile de Userformu kapatıyorum. ListBox1 dolu da olsa boşta olsa userform kapanıyor. Benim istediğim ListBox1 dolu ise kapanmasın uyarı mesajı versin.
................................................................................................
Private Sub CommandButton3_Click() 'KAPAT butonu
Unload Me
End Sub
................................................................................................
"AKTARILMAYAN KAYITLAR VAR!
AKTARMAK İSTİYORMUSUNUZ?"
Evet ise
Call CommandButton1_Click()
Hayır ise
"KAPATMAK İSTEDİĞİNİZDEN EMİN MİSİNİZ?
Evet ise
Unload Me
Hayır ise
MultiPage1.Value = 0
Userform da ListBox1 oluşturup içerisindeki verileri sayfa1'e aktarıp, ListBox1 i temizleyip, çalışma kitabını aşağıdaki kod ile kaydediyorum.
Private Sub CommandButton1_Click()
Dim i As Long, s As Long, a As Long
s = Sayfa1.Range("a65536").End(3).Row
For i = 1 To 5
For a = 0 To ListBox1.ListCount - 1
Sayfa1.Cells(s + a + 1, i).Value = ListBox1.List(a, i - 1)
Next a
Next i
MsgBox "Sonuçlar aktarılmıştır.", vbInformation, "İşlem Tamam - YaVuZ"
ListBox1.Clear
Application.ScreenUpdating = False
If MsgBox("YAPILAN İŞLEMLERİ KAYDETMEK İSTİYORMUSUNUZ?", vbYesNo + vbQuestion, "KAYDET") = vbYes Then
ThisWorkbook.Save
MsgBox "YAPILAN İŞLEMLER KAYDEDİLDİ.", vbInformation, " KAYIT - YaVuZ"
Else
Exit Sub
End If
Call TextBox1_Enter
End Sub
Aşağıdaki kod ile de Userformu kapatıyorum. ListBox1 dolu da olsa boşta olsa userform kapanıyor. Benim istediğim ListBox1 dolu ise kapanmasın uyarı mesajı versin.
................................................................................................
Private Sub CommandButton3_Click() 'KAPAT butonu
Unload Me
End Sub
................................................................................................
"AKTARILMAYAN KAYITLAR VAR!
AKTARMAK İSTİYORMUSUNUZ?"
Evet ise
Call CommandButton1_Click()
Hayır ise
"KAPATMAK İSTEDİĞİNİZDEN EMİN MİSİNİZ?
Evet ise
Unload Me
Hayır ise
MultiPage1.Value = 0
Son düzenleme:
