VBA ' de End Sub hatası

Katılım
29 Aralık 2006
Mesajlar
80
Excel Vers. ve Dili
visualbasic
Yapmakta olduğum bir programda raporlama yaptırmak istiyorum .Fakat hata veriyor.Lütfen yardım edermisiniz.
Sub Auto_Open()
Sheets("ALAKART").[AM5] = Evaluate("=sumIF(c:c,""" & Format("01/01/2008", "00000")
Sheets("ALAKART").[AM6] = Evaluate("=sumIF(c:c,""" & Format("02/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM7] = Evaluate("=sumIF(c:c,""" & Format("03/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM8] = Evaluate("=sumIF(c:c,""" & Format("04/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM9] = Evaluate("=sumIF(c:c,""" & Format("05/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM10] = Evaluate("=sumIF(c:c,""" & Format("06/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM11] = Evaluate("=sumIF(c:c,""" & Format("07/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM12] = Evaluate("=sumIF(c:c,""" & Format("08/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM13] = Evaluate("=sumIF(c:c,""" & Format("09/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM14] = Evaluate("=sumIF(c:c,""" & Format("10/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM15] = Evaluate("=sumIF(c:c,""" & Format("11/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM16] = Evaluate("=sumIF(c:c,""" & Format("12/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM17] = Evaluate("=sumIF(c:c,""" & Format("13/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM18] = Evaluate("=sumIF(c:c,""" & Format("14/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM19] = Evaluate("=sumIF(c:c,""" & Format("15/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM20] = Evaluate("=sumIF(c:c,""" & Format("16/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM21] = Evaluate("=sumIF(c:c,""" & Format("17/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM22] = Evaluate("=sumIF(c:c,""" & Format("18/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM23] = Evaluate("=sumIF(c:c,""" & Format("19/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM24] = Evaluate("=sumIF(c:c,""" & Format("20/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM25] = Evaluate("=sumIF(c:c,""" & Format("21/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM26] = Evaluate("=sumIF(c:c,""" & Format("22/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM27] = Evaluate("=sumIF(c:c,""" & Format("23/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM28] = Evaluate("=sumIF(c:c,""" & Format("24/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM29] = Evaluate("=sumIF(c:c,""" & Format("25/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM30] = Evaluate("=sumIF(c:c,""" & Format("26/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM31] = Evaluate("=sumIF(c:c,""" & Format("27/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM32] = Evaluate("=sumIF(c:c,""" & Format("28/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM33] = Evaluate("=sumIF(c:c,""" & Format("29/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM34] = Evaluate("=sumIF(c:c,""" & Format("30/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AM35] = Evaluate("=sumIF(c:c,""" & Format("31/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AJ5] = Evaluate("=Min(if(c2:c15000 = " & "AI5" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ6] = Evaluate("=Min(if(c2:c15000 = " & "AI6" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ7] = Evaluate("=Min(if(c2:c15000 = " & "AI7" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ8] = Evaluate("=Min(if(c2:c15000 = " & "AI8" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ9] = Evaluate("=Min(if(c2:c15000 = " & "AI9" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ10] = Evaluate("=Min(if(c2:c15000 = " & "AI10" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ11] = Evaluate("=Min(if(c2:c15000 = " & "AI11" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ12] = Evaluate("=Min(if(c2:c15000 = " & "AI12" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ13] = Evaluate("=Min(if(c2:c15000 = " & "AI13" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ14] = Evaluate("=Min(if(c2:c15000 = " & "AI14" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ15] = Evaluate("=Min(if(c2:c15000 = " & "AI15" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ16] = Evaluate("=Min(if(c2:c15000 = " & "AI16" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ17] = Evaluate("=Min(if(c2:c15000 = " & "AI17" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ18] = Evaluate("=Min(if(c2:c15000 = " & "AI18" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ19] = Evaluate("=Min(if(c2:c15000 = " & "AI19" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ20] = Evaluate("=Min(if(c2:c15000 = " & "AI20" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ21] = Evaluate("=Min(if(c2:c15000 = " & "AI21" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ22] = Evaluate("=Min(if(c2:c15000 = " & "AI22" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ23] = Evaluate("=Min(if(c2:c15000 = " & "AI23" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ24] = Evaluate("=Min(if(c2:c15000 = " & "AI24" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ25] = Evaluate("=Min(if(c2:c15000 = " & "AI25" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ26] = Evaluate("=Min(if(c2:c15000 = " & "AI26" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ27] = Evaluate("=Min(if(c2:c15000 = " & "AI27" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ28] = Evaluate("=Min(if(c2:c15000 = " & "AI28" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ29] = Evaluate("=Min(if(c2:c15000 = " & "AI29" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ30] = Evaluate("=Min(if(c2:c15000 = " & "AI30" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ31] = Evaluate("=Min(if(c2:c15000 = " & "AI31" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ32] = Evaluate("=Min(if(c2:c15000 = " & "AI32" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ33] = Evaluate("=Min(if(c2:c15000 = " & "AI33" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ34] = Evaluate("=Min(if(c2:c15000 = " & "AI34" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AJ35] = Evaluate("=Min(if(c2:c15000 = " & "AI35" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AK5] = Evaluate("=Max(if(c2:c15000 = " & "AI5" & ", b2:b15000 ))")
Sheets("ALAKART").[AK6] = Evaluate("=Max(if(c2:c15000 = " & "AI6" & ", b2:b15000 ))")
Sheets("ALAKART").[AK7] = Evaluate("=Max(if(c2:c15000 = " & "AI7" & ", b2:b15000 ))")
Sheets("ALAKART").[AK8] = Evaluate("=Max(if(c2:c15000 = " & "AI8" & ", b2:b15000 ))")
Sheets("ALAKART").[AK9] = Evaluate("=Max(if(c2:c15000 = " & "AI9" & ", b2:b15000 ))")
Sheets("ALAKART").[AK10] = Evaluate("=Max(if(c2:c15000 = " & "AI10" & ", b2:b15000 ))")
Sheets("ALAKART").[AK11] = Evaluate("=Max(if(c2:c15000 = " & "AI11" & ", b2:b15000 ))")
Sheets("ALAKART").[AK12] = Evaluate("=Max(if(c2:c15000 = " & "AI12" & ", b2:b15000 ))")
Sheets("ALAKART").[AK13] = Evaluate("=Max(if(c2:c15000 = " & "AI13" & ", b2:b15000 ))")
Sheets("ALAKART").[AK14] = Evaluate("=Max(if(c2:c15000 = " & "AI14" & ", b2:b15000 ))")
Sheets("ALAKART").[AK15] = Evaluate("=Max(if(c2:c15000 = " & "AI15" & ", b2:b15000 ))")
Sheets("ALAKART").[AK16] = Evaluate("=Max(if(c2:c15000 = " & "AI16" & ", b2:b15000 ))")
Sheets("ALAKART").[AK17] = Evaluate("=Max(if(c2:c15000 = " & "AI17" & ", b2:b15000 ))")
Sheets("ALAKART").[AK18] = Evaluate("=Max(if(c2:c15000 = " & "AI18" & ", b2:b15000 ))")
Sheets("ALAKART").[AK19] = Evaluate("=Max(if(c2:c15000 = " & "AI19" & ", b2:b15000 ))")
Sheets("ALAKART").[AK20] = Evaluate("=Max(if(c2:c15000 = " & "AI20" & ", b2:b15000 ))")
Sheets("ALAKART").[AK21] = Evaluate("=Max(if(c2:c15000 = " & "AI21" & ", b2:b15000 ))")
Sheets("ALAKART").[AK22] = Evaluate("=Max(if(c2:c15000 = " & "AI22" & ", b2:b15000 ))")
Sheets("ALAKART").[AK23] = Evaluate("=Max(if(c2:c15000 = " & "AI23" & ", b2:b15000 ))")
Sheets("ALAKART").[AK24] = Evaluate("=Max(if(c2:c15000 = " & "AI24" & ", b2:b15000 ))")
Sheets("ALAKART").[AK25] = Evaluate("=Max(if(c2:c15000 = " & "AI25" & ", b2:b15000 ))")
Sheets("ALAKART").[AK26] = Evaluate("=Max(if(c2:c15000 = " & "AI26" & ", b2:b15000 ))")
Sheets("ALAKART").[AK27] = Evaluate("=Max(if(c2:c15000 = " & "AI27" & ", b2:b15000 ))")
Sheets("ALAKART").[AK28] = Evaluate("=Max(if(c2:c15000 = " & "AI28" & ", b2:b15000 ))")
Sheets("ALAKART").[AK29] = Evaluate("=Max(if(c2:c15000 = " & "AI29" & ", b2:b15000 ))")
Sheets("ALAKART").[AK30] = Evaluate("=Max(if(c2:c15000 = " & "AI30" & ", b2:b15000 ))")
Sheets("ALAKART").[AK31] = Evaluate("=Max(if(c2:c15000 = " & "AI31" & ", b2:b15000 ))")
Sheets("ALAKART").[AK32] = Evaluate("=Max(if(c2:c15000 = " & "AI32" & ", b2:b15000 ))")
Sheets("ALAKART").[AK33] = Evaluate("=Max(if(c2:c15000 = " & "AI33" & ", b2:b15000 ))")
Sheets("ALAKART").[AK34] = Evaluate("=Max(if(c2:c15000 = " & "AI34" & ", b2:b15000 ))")
Sheets("ALAKART").[AK35] = Evaluate("=Max(if(c2:c15000 = " & "AI35" & ", b2:b15000 ))")
Sheets("ALAKART").[AL5] = Evaluate("=COUNTIF(c:c,""" & Format("01/01/2008", "00000") & """)")
Sheets("ALAKART").[AL6] = Evaluate("=COUNTIF(c:c,""" & Format("02/01/2008", "00000") & """)")
Sheets("ALAKART").[AL7] = Evaluate("=COUNTIF(c:c,""" & Format("03/01/2008", "00000") & """)")
Sheets("ALAKART").[AL8] = Evaluate("=COUNTIF(c:c,""" & Format("04/01/2008", "00000") & """)")
Sheets("ALAKART").[AL9] = Evaluate("=COUNTIF(c:c,""" & Format("05/01/2008", "00000") & """)")
Sheets("ALAKART").[AL10] = Evaluate("=COUNTIF(c:c,""" & Format("06/01/2008", "00000") & """)")
Sheets("ALAKART").[AL11] = Evaluate("=COUNTIF(c:c,""" & Format("07/01/2008", "00000") & """)")
Sheets("ALAKART").[AL12] = Evaluate("=COUNTIF(c:c,""" & Format("08/01/2008", "00000") & """)")
Sheets("ALAKART").[AL13] = Evaluate("=COUNTIF(c:c,""" & Format("09/01/2008", "00000") & """)")
Sheets("ALAKART").[AL14] = Evaluate("=COUNTIF(c:c,""" & Format("10/01/2008", "00000") & """)")
Sheets("ALAKART").[AL15] = Evaluate("=COUNTIF(c:c,""" & Format("11/01/2008", "00000") & """)")
Sheets("ALAKART").[AL16] = Evaluate("=COUNTIF(c:c,""" & Format("12/01/2008", "00000") & """)")
Sheets("ALAKART").[AL17] = Evaluate("=COUNTIF(c:c,""" & Format("13/01/2008", "00000") & """)")
Sheets("ALAKART").[AL18] = Evaluate("=COUNTIF(c:c,""" & Format("14/01/2008", "00000") & """)")
Sheets("ALAKART").[AL19] = Evaluate("=COUNTIF(c:c,""" & Format("15/01/2008", "00000") & """)")
Sheets("ALAKART").[AL20] = Evaluate("=COUNTIF(c:c,""" & Format("16/01/2008", "00000") & """)")
Sheets("ALAKART").[AL21] = Evaluate("=COUNTIF(c:c,""" & Format("17/01/2008", "00000") & """)")
Sheets("ALAKART").[AL22] = Evaluate("=COUNTIF(c:c,""" & Format("18/01/2008", "00000") & """)")
Sheets("ALAKART").[AL23] = Evaluate("=COUNTIF(c:c,""" & Format("19/01/2008", "00000") & """)")
Sheets("ALAKART").[AL24] = Evaluate("=COUNTIF(c:c,""" & Format("20/01/2008", "00000") & """)")
Sheets("ALAKART").[AL25] = Evaluate("=COUNTIF(c:c,""" & Format("21/01/2008", "00000") & """)")
Sheets("ALAKART").[AL26] = Evaluate("=COUNTIF(c:c,""" & Format("22/01/2008", "00000") & """)")
Sheets("ALAKART").[AL27] = Evaluate("=COUNTIF(c:c,""" & Format("23/01/2008", "00000") & """)")
Sheets("ALAKART").[AL28] = Evaluate("=COUNTIF(c:c,""" & Format("24/01/2008", "00000") & """)")
Sheets("ALAKART").[AL29] = Evaluate("=COUNTIF(c:c,""" & Format("25/01/2008", "00000") & """)")
Sheets("ALAKART").[AL30] = Evaluate("=COUNTIF(c:c,""" & Format("26/01/2008", "00000") & """)")
Sheets("ALAKART").[AL31] = Evaluate("=COUNTIF(c:c,""" & Format("27/01/2008", "00000") & """)")
Sheets("ALAKART").[AL32] = Evaluate("=COUNTIF(c:c,""" & Format("28/01/2008", "00000") & """)")
Sheets("ALAKART").[AL33] = Evaluate("=COUNTIF(c:c,""" & Format("29/01/2008", "00000") & """)")
Sheets("ALAKART").[AL34] = Evaluate("=COUNTIF(c:c,""" & Format("30/01/2008", "00000") & """)")
Sheets("ALAKART").[AL35] = Evaluate("=COUNTIF(c:c,""" & Format("31/01/2008", "00000") & """)")
End Sub
Bu kodlarla o aya ait gün gün ve ogünün toplamı ,fatura adeti,ilk fatura ve son fatura numaralarını raporlamak istiyorum.Fakat End Sub 'un üzeri mavileşiyor ve hata veriyor.Makro çalışmıyor.Ayrıca Commanbuttona verdim yine hata verdi.Bu arada bir günlük kod girdiğim zaman sorun yok.Ör:01.01.2008 E göre
Sheets("ALAKART").[AM5] = Evaluate("=sumIF(c:c,""" & Format("01/01/2008", "00000") & """,e:e)")
Sheets("ALAKART").[AJ5] = Evaluate("=Min(if(c2:c15000 = " & "AI5" & ", if(b2:b15000 > " & 0 & ", b2:b15000 )))")
Sheets("ALAKART").[AK5] = Evaluate("=Max(if(c2:c15000 = " & "AI5" & ", b2:b15000 ))")
Sheets("ALAKART").[AL5] = Evaluate("=COUNTIF(c:c,""" & Format("01/01/2008", "00000") & """)") bir günlük gidiğim zaman hata vermiyor.Lütfen Yardım
Ayrıca bundan daha kolay olacak bir şekilde raporlamayı nasıl yaptırırım.Çünki 12 aylık kod girmem gerekiyor.Ve her yıl bu kodları değiştirmem gerekiyor.
 
S

Skorpiyon

Misafir
Sayın Can042,

Bu kadar kod yerine küçük bir örnek dosya yardım almanızı daha da kolaylaştıracaktır.

Saygılarımla...
 
Üst