- Katılım
- 14 Ocak 2008
- Mesajlar
- 176
- Excel Vers. ve Dili
- 2010 türkçe
hesapla makrosu ile bazı işlemler yaptırıyorum, bu işlemler sırasında form açılıyor ve içindeki texboxlara veri girişleri yapıp makroyu devam ettiriyorum, yalnız bu form üzerine command büton (kapat) ekledim, bu bütonu tıklayarak, makroyu nasıl sonlandırabilirim. (çünkü formu kapattırdığımda makro kaldığı yerden devam ediyor)
Sub İSTATİSTİK()
Set s1 = Sheets(".............")
If s1.Range("T6") = "" Then: MsgBox "Denetim Tarihi ?", vbCritical, " EKSİK BİLGİ": Exit Sub
If s1.Range("E7") = "" Then: MsgBox "Denetlenen Bölge ?", vbCritical, " EKSİK BİLGİ": Exit Sub
If MsgBox(s1.Range("T6") & " Tarihli Bu İşlem Kaydedilsin mi ? ", vbQuestion + vbYesNo, " YAZDIR") = vbNo Then Exit Sub
If CreateObject("scripting.filesystemobject").fileexists(ThisWorkbook.Path & "\Hsyn istatistik\" & Format(s1.Range("T6"), "mmmm") & ".xls") Then
If s1.Range("E7") = "ŞEHİRİÇİ" Then
YAZILILAR.Show
End If
Call İSTATİSTİKAKTAR
Else
If MsgBox(Format(s1.Range("T6"), "mmmm") & " Ayına Ait Dosya Kayıtlarda Bulunamadı." & vbLf & "Dosya Oluşturulsun mu ?", vbQuestion + vbYesNo, " B İ L G İ") = vbNo Then Exit Sub
CreateObject("scripting.filesystemobject").copyfile ThisWorkbook.Path & "\Hsyn istatistik\ŞABLON\SABLON.xls", ThisWorkbook.Path & "\Hsyn istatistik\" & Format(s1.Range("T6"), "mmmm") & ".xls"
Call İSTATİSTİKAKTAR
End If
End Sub
YAZILILAR.Show bu formun içindeki kapat tuşuna tıkladığımda, istatistik makrosunu sonlandırsın
Sub İSTATİSTİK()
Set s1 = Sheets(".............")
If s1.Range("T6") = "" Then: MsgBox "Denetim Tarihi ?", vbCritical, " EKSİK BİLGİ": Exit Sub
If s1.Range("E7") = "" Then: MsgBox "Denetlenen Bölge ?", vbCritical, " EKSİK BİLGİ": Exit Sub
If MsgBox(s1.Range("T6") & " Tarihli Bu İşlem Kaydedilsin mi ? ", vbQuestion + vbYesNo, " YAZDIR") = vbNo Then Exit Sub
If CreateObject("scripting.filesystemobject").fileexists(ThisWorkbook.Path & "\Hsyn istatistik\" & Format(s1.Range("T6"), "mmmm") & ".xls") Then
If s1.Range("E7") = "ŞEHİRİÇİ" Then
YAZILILAR.Show
End If
Call İSTATİSTİKAKTAR
Else
If MsgBox(Format(s1.Range("T6"), "mmmm") & " Ayına Ait Dosya Kayıtlarda Bulunamadı." & vbLf & "Dosya Oluşturulsun mu ?", vbQuestion + vbYesNo, " B İ L G İ") = vbNo Then Exit Sub
CreateObject("scripting.filesystemobject").copyfile ThisWorkbook.Path & "\Hsyn istatistik\ŞABLON\SABLON.xls", ThisWorkbook.Path & "\Hsyn istatistik\" & Format(s1.Range("T6"), "mmmm") & ".xls"
Call İSTATİSTİKAKTAR
End If
End Sub
YAZILILAR.Show bu formun içindeki kapat tuşuna tıkladığımda, istatistik makrosunu sonlandırsın