Hata Kodu 400

Katılım
7 Eylül 2004
Mesajlar
49
Excel Makrosunda Haa Kodu 400 Vermektedİr. Sebebİ Nedİr Ve Bu Hatayi Nasil Gİderebİlİrİm.
LÜtfen Yardimci Olunuz.
 
Katılım
12 Mart 2006
Mesajlar
124
Excel Vers. ve Dili
MS Office 2003 Türkçe
Kendi dosyanızı veya örnek bir dosyayı buraya koyarsanız net cevap alabilirsiniz.
 

zafer

Super Moderator
Yönetici
Katılım
8 Mart 2005
Mesajlar
3,288
Excel Vers. ve Dili
OFFICE 2003 TÜRKÇE
OFFICE 2010 TÜRKÇE
Merhaba

Run-time error'400' (unload userform Hatası)

kapatmak istediğiniz userform'un ismi yanlış olabilir.
 
Katılım
7 Eylül 2004
Mesajlar
49
Öncelikle ilginiz için teşekkür ederim.
Dosya boyutu büyük oldugu için kodlamayı gönderiyorum.
2. satıra "On Error Resume Next" eklemem halinde hata kodu vermeksizin makro çalışmaktadır.Diger halde hata kodu 400 vermekte, hata ile ilgili açıklama vermemekteir.




Sub K()
x = 260 'FİRMA SATIR SAYISI
Sayfa6.[B:B].SpecialCells(xlCellTypeBlanks).EntireRow.Delete 'B SUTUNU BOŞ OLAN SATIRLARI SİLER
For i = 3 To 2650 'F SAYFASI SATIR SAYISI
For a = 1 To x
If Cells(i, 41) > 0 And Cells(i, 41) = Sayfa6.Cells(a, 1) Then 'STOK KODU EŞİT İSE
If Cells(i, 45) <> Sayfa6.Cells(a, 5) Then 'FİYATLAR FARKLI İSE
Cells(i, 45) = Sayfa6.Cells(a, 5) 'YENİ FİYATI AKTAR
With Cells(i, 45).Interior 'RENKLENDİRME
.ColorIndex = 33
.Pattern = xlSolid
End With
End If
Sayfa6.Rows(a).EntireRow.Delete ' FİRMA SAYFASINDA a. SATIRINI SİLER
a = x 'DÖNGÜYÜ BİTİRMESİ İÇİN
x = x - 1
End If
Next a
Next i
MsgBox "GUNCELLEME TAMAMLANDI"
End Sub
 
Katılım
12 Mart 2006
Mesajlar
124
Excel Vers. ve Dili
MS Office 2003 Türkçe
Sub K()
On Error Resume Next
x = 260 'F&#304;RMA SATIR SAYISI

&#350;eklinde yazd&#305;&#287;&#305;n&#305;zda kodlar i&#351;levini yerine getiriyorsa o g&#252;zel kafan&#305; niye yoruyon hocam.

Ver co&#351;kuyu o zaman :)))))
 
Katılım
13 Haziran 2007
Mesajlar
25
Excel Vers. ve Dili
excel 2010-ingilizce
Excel VBA 400 HATASI

Merhabalar

Aşağıdaki makro bir excel sheetindeki datayı inbox kutusunda belirtecegimiz sayı dogrultusunda satılara boluyor, akabinde toplam, genel toplam ve nakli yekun alıyor.
Bu sefer makroyu çalıştırdıgım data çok yuklu (500 000 satır) bu sebeple 133,120 nci satırda hata verdi.

Herhangi bir satır sınırlamasına maruz kalmadan çalışmasını saglayabilirmiyiz.

Desteğiniz icin şimdiden çok tesekkurler.
***********
Sub sayfa_bol()
Dim topsatir, satir As Long
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$N"
End With
Cells.Select
ActiveSheet.ResetAllPageBreaks
satir = InputBox("Sayfalari Kacar Satir Isterdiniz?")
'topsatir = InputBox("Aktif Sheet'in satir sayisi lutfen?")
i = 2
newpage = 0
nakliyekun = 0
Do While Cells(i, 1) <> ""
sayac = sayac + 1
If newpage Then
Rows(i + 1).Select
Selection.Insert Shift:=xlDown
Cells(i + 1, 1) = Cells(i, 1)
Cells(i + 1, 2) = Cells(i, 2)
Cells(i + 1, 3) = Cells(i, 3)
Cells(i + 1, 4) = Cells(i, 4)
Cells(i + 1, 5) = Cells(i, 5)
Cells(i + 1, 6) = Cells(i, 6)
Cells(i + 1, 7) = Cells(i, 7)
Cells(i + 1, 8) = Cells(i, 8)
Cells(i + 1, 9) = Cells(i, 9)
Cells(i + 1, 10) = Cells(i, 10)
Cells(i + 1, 11) = Cells(i, 11)
Cells(i + 1, 12) = Cells(i, 12)
Cells(i + 1, 13) = Cells(i, 13)
Cells(i + 1, 14) = Cells(i, 14)
Cells(i, 1) = ""
Cells(i, 2) = ""
Cells(i, 3) = ""
Cells(i, 4) = "Nakli Yekun"
Cells(i, 5) = nakliyekun5
Cells(i, 6) = nakliyekun6
Cells(i, 7) = nakliyekun7
Cells(i, 8) = nakliyekun8
Cells(i, 9) = nakliyekun9
Cells(i, 10) = ""
Cells(i, 11) = ""
Cells(i, 12) = ""
Cells(i, 13) = ""
Cells(i, 14) = ""
i = i + 1
newpage = 0
End If
toplam5 = toplam5 + Cells(i, 5)
toplam6 = toplam6 + Cells(i, 6)
toplam7 = toplam7 + Cells(i, 7)
toplam8 = toplam8 + Cells(i, 8)
toplam9 = toplam9 + Cells(i, 9)
If sayac = satir Then
Rows(i + 1).Select
Selection.Insert Shift:=xlUp
Cells(i + 1, 4) = "Toplam"
Cells(i + 1, 5) = toplam5
Cells(i + 1, 6) = toplam6
Cells(i + 1, 7) = toplam7
Cells(i + 1, 8) = toplam8
Cells(i + 1, 9) = toplam9
Rows(i + 2).Select
Selection.Insert Shift:=xlDown
Cells(i + 2, 4) = "Genel Toplam"
Cells(i + 2, 5) = nakliyekun5 + toplam5
Cells(i + 2, 6) = nakliyekun6 + toplam6
Cells(i + 2, 7) = nakliyekun7 + toplam7
Cells(i + 2, 8) = nakliyekun8 + toplam8
Cells(i + 2, 9) = nakliyekun9 + toplam9
Rows(i + 3).Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
newpage = 1
i = i + 2
sayac = 0
nakliyekun5 = nakliyekun5 + toplam5
nakliyekun6 = nakliyekun6 + toplam6
nakliyekun7 = nakliyekun7 + toplam7
nakliyekun8 = nakliyekun8 + toplam8
nakliyekun9 = nakliyekun9 + toplam9
toplam5 = 0
toplam6 = 0
toplam7 = 0
toplam8 = 0
toplam9 = 0

End If
i = i + 1
Loop
End Sub
************
 
Üst