- Katılım
- 20 Kasım 2010
- Mesajlar
- 62
- Excel Vers. ve Dili
- Excel 2007 - Excel 2010 TÜRKÇE
Merhabalar
Userform bulunan excelim sürekli hata veriyor.Kodları aşağıda, İlk anda gözünüze çarpan bir şey var mı acaba ? Yardımcı olabilirseniz çok sevinirim bütün işlerimi alt üst etti.
Userform bulunan excelim sürekli hata veriyor.Kodları aşağıda, İlk anda gözünüze çarpan bir şey var mı acaba ? Yardımcı olabilirseniz çok sevinirim bütün işlerimi alt üst etti.
Kod:
Private Sub ComboBox1_Change()
With Sheets("Y.MAMUL F-E01-23")
For Each ara In .Range("B2:B" & Sheets("Y.MAMUL F-E01-23").Range("B65536").End(3).Row)
If CStr(ara.Value) = CStr(ComboBox1.Value) Then
TextBox10.Value = ara.Offset(0, 15).Value
TextBox11.Value = ara.Offset(0, 16).Value
TextBox12.Value = ara.Offset(0, 17).Value
TextBox13.Value = ara.Offset(0, 18).Value
TextBox14.Value = ara.Offset(0, 19).Value
TextBox17.Value = ara.Offset(0, 7).Value
TextBox18.Value = ara.Offset(0, 8).Value & " " & "g"
TextBox19.Value = ara.Offset(0, 9).Value & " " & "g"
End If
Next ara
End With
Call BUL_MAKİNE
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub ComboBox3_Change()
ComboBox1.Clear
Set s1 = Sheets("Y.MAMUL F-E01-23")
Set Aralik = s1.Range("F2:F" & [F65536].End(3).Row)
Set BUL = Aralik.Find(ComboBox3.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
Adres = BUL.Address
Do
If s1.Cells(BUL.Row, "C") = ComboBox2.Text Then
ComboBox1.AddItem Cells(BUL.Row, 2)
End If
Set BUL = Aralik.FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> Adres
End If
End Sub
Private Sub ComboBox4_Change()
End Sub
Private Sub ComboBox5_Change()
End Sub
Private Sub ComboBox6_Change()
End Sub
Private Sub CommandButton2_Click()
Unload Me
Application.Visible = True
End Sub
Private Sub CommandButton3_Click()
End Sub
Private Sub CommandButton7_Click()
With Sheets("Y.MAMUL F-E01-23")
For Each ara In .Range("B2:B" & Sheets("Y.MAMUL F-E01-23").Range("B65536").End(3).Row)
If CStr(ara.Value) = CStr(ComboBox1.Value) Then
TextBox32.Value = TextBox1.Value * (ara.Offset(0, 8).Value + ara.Offset(0, 9).Value) / 1000 & " " & "Kg"
End If
Next ara
End With
End Sub
Private Sub Frame1_Click()
End Sub
Private Sub Frame2_Click()
End Sub
Private Sub Image1_Click()
End Sub
Private Sub ComboBox7_Change()
End Sub
Private Sub ComboBox8_Change()
End Sub
Private Sub ComboBox9_Change()
End Sub
Private Sub CommandButton1_Click()
Set s1 = Sheets("ÜRETİM PLANI 2011 F-E01-20")
sonsat = s1.Range("A65536").End(3).Row
say = WorksheetFunction.CountIf(s1.Range("A2:A" & sonsat), TextBox9.Text)
If say = 0 Then Exit Sub
Aranan = TextBox9.Text
i = s1.Range("A1:A" & sonsat).Find(What:=Aranan, LookAt:=xlWhole).Row
s1.Cells(i, 2) = TextBox8.Value
s1.Cells(i, 3) = ComboBox1.Value
s1.Cells(i, 4) = TextBox1.Value
s1.Cells(i, 19) = ComboBox4.Value
s1.Cells(i, 20) = ComboBox6.Value
s1.Cells(i, 21) = ComboBox5.Value
s1.Cells(i, 22) = ComboBox9.Value
s1.Cells(i, 23) = ComboBox7.Value
s1.Cells(i, 24) = ComboBox8.Value
s1.Cells(i, 26) = TextBox15.Value
s1.Cells(i, 27) = TextBox16.Value
Call yazdır
MsgBox " *" & ComboBox1.Text & " " & "-" & " " & TextBox1.Value & "*" & " " & "Adet Yazdırıldı."
Call TEMİZLE
Call AKTAR
End Sub
Private Sub Image3_Click()
Call TEMİZLE
End Sub
Private Sub Image4_Click()
ThisWorkbook.Close
End Sub
Private Sub Image5_Click()
ActiveWorkbook.Save
MsgBox "KAYIT EDİLDİ.!"
End Sub
Private Sub Label11_Click()
End Sub
Private Sub Label12_Click()
End Sub
Private Sub Label14_Click()
End Sub
Private Sub Label15_Click()
End Sub
Private Sub Label16_Click()
End Sub
Private Sub Label2_Click()
End Sub
Private Sub Label23_Click()
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Label32_Click()
End Sub
Private Sub Label39_Click()
End Sub
Private Sub Label4_Click()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub ListBox2_Click()
End Sub
Private Sub MultiPage1_Change()
End Sub
Private Sub SpinButton1_SpinUp()
Set s1 = Sheets("ÜRETİM PLANI 2011 F-E01-20")
i = s1.Cells.Find(TextBox9.Text).Row
TextBox9.Text = s1.Cells(i + 1, 1)
End Sub
Private Sub SpinButton1_SpinDown()
Set s1 = Sheets("ÜRETİM PLANI 2011 F-E01-20")
i = s1.Cells.Find(TextBox9.Text).Row
TextBox9.Text = s1.Cells(i - 1, 1)
End Sub
Private Sub SpinButton1_Change()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox10_Change()
End Sub
Private Sub TextBox11_Change()
End Sub
Private Sub TextBox12_Change()
End Sub
Private Sub TextBox13_Change()
End Sub
Private Sub TextBox14_Change()
End Sub
Private Sub TextBox15_Change()
End Sub
Private Sub TextBox16_Change()
End Sub
Private Sub TextBox17_Change()
End Sub
Private Sub TextBox18_Change()
End Sub
Private Sub TextBox19_Change()
End Sub
Private Sub TextBox32_Change()
TextBox32 = Format(TextBox32, "###.0")
End Sub
Private Sub TextBox8_Change()
End Sub
Private Sub TextBox9_Change()
End Sub
Private Sub UserForm_Initialize()
ComboBox2.RowSource = "VERİ!$A$124:$A$135"
ComboBox3.RowSource = "VERİ!$A$137:$A$150"
Call AKTAR
End Sub
Private Sub AKTAR()
i = 3
Do Until Sheets("ÜRETİM PLANI 2011 F-E01-20").Cells(i, 2) = ""
i = i + 1
Loop
TextBox9.Text = Worksheets("ÜRETİM PLANI 2011 F-E01-20").Cells(i, 1).Value
With TextBox8
.Text = Date
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Sub BUL_MAKİNE()
Set s2 = Sheets("Y.MAMUL F-E01-23")
Set BUL = s2.Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(s2.Range(Cells(BUL.Row, 23), Cells(BUL.Row, 32))) > 0 Then
ComboBox4.Clear
For Each SATIR In s2.Range(Cells(BUL.Row, 23), Cells(BUL.Row, 32)).SpecialCells(xlCellTypeConstants, 1)
ComboBox4.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox4.AddItem Cells(1, SATIR.Column)
End If
End If
End If
Set BUL = Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(Range(Cells(BUL.Row, 34), Cells(BUL.Row, 46))) > 0 Then
ComboBox8.Clear
For Each SATIR In Range(Cells(BUL.Row, 34), Cells(BUL.Row, 46)).SpecialCells(xlCellTypeConstants, 1)
ComboBox8.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox8.AddItem Cells(1, SATIR.Column)
End If
End If
End If
Set BUL = Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(Range(Cells(BUL.Row, 48), Cells(BUL.Row, 54))) > 0 Then
ComboBox5.Clear
For Each SATIR In Range(Cells(BUL.Row, 48), Cells(BUL.Row, 54)).SpecialCells(xlCellTypeConstants, 1)
ComboBox5.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox5.AddItem Cells(1, SATIR.Column)
End If
End If
End If
Set BUL = Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(Range(Cells(BUL.Row, 59), Cells(BUL.Row, 60))) > 0 Then
ComboBox9.Clear
For Each SATIR In Range(Cells(BUL.Row, 59), Cells(BUL.Row, 60)).SpecialCells(xlCellTypeConstants, 1)
ComboBox9.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox9.AddItem Cells(1, SATIR.Column)
End If
End If
End If
Set BUL = Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(Range(Cells(BUL.Row, 62), Cells(BUL.Row, 64))) > 0 Then
ComboBox6.Clear
For Each SATIR In Range(Cells(BUL.Row, 62), Cells(BUL.Row, 64)).SpecialCells(xlCellTypeConstants, 1)
ComboBox6.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox6.AddItem Cells(1, SATIR.Column)
End If
End If
End If
Set BUL = Range("B2:B" & Rows.Count).Find(ComboBox1.Text, LookIn:=xlValues, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If WorksheetFunction.Count(Range(Cells(BUL.Row, 66), Cells(BUL.Row, 67))) > 0 Then
ComboBox7.Clear
For Each SATIR In Range(Cells(BUL.Row, 66), Cells(BUL.Row, 67)).SpecialCells(xlCellTypeConstants, 1)
ComboBox7.AddItem Cells(1, SATIR.Column)
Next
If ComboBox1.Value = Change Then
ComboBox7.AddItem Cells(1, SATIR.Column)
End If
End If
End If
End Sub
Sub yazdır()
Set s1 = Sheets("DEPO ÇIKIŞ İŞ EMRİ F-E01-2")
Set s2 = Sheets("ÜRETİM PLANI 2011 F-E01-20")
Set s3 = Sheets("TESTERE İŞ EMRİ F-E01-3")
Set s4 = Sheets("İNDEX İŞ EMRİ F-E01-5")
Set s5 = Sheets("CNC İŞ EMRİ F-E01-18")
Set s6 = Sheets("PRESHANE İŞ EMRİ F-E01-4")
Set s7 = Sheets("KÜRE İŞ EMRİ F-E01-8")
Set s8 = Sheets("KAPLAMA İŞ EMRİ F-E01-19")
Set s9 = Sheets("TRANSFER İŞ EMRİ F-E01-17")
Set s10 = Sheets("ROVELVER İŞ EMRİ F-E01-16")
s1.Cells(1, 3) = ""
i = 3
Do Until s2.Cells(i, 2) = ""
i = i + 1
Loop
s1.Cells(1, 3) = s2.Cells(i - 1, 1)
If s2.Cells(i - 1, 10) = "TES" Then
s1.PrintOut
s3.PrintOut
End If
If s2.Cells(i - 1, 10) = "İNDEX" Then
s1.PrintOut
s4.PrintOut
End If
If s2.Cells(i - 1, 10) = "CNC" Then
s1.PrintOut
s3.PrintOut
s5.PrintOut
End If
If s2.Cells(i - 1, 11) = "PRES" Then
s6.PrintOut
End If
If s2.Cells(i - 1, 11) = "KÜRE" Then
s7.PrintOut
End If
If s2.Cells(i - 1, 11) = "KAP" Then
s8.PrintOut
End If
If s2.Cells(i - 1, 12) = "CNC" Then
s5.PrintOut
End If
If s2.Cells(i - 1, 12) = "KAP" Then
s8.PrintOut
End If
If s2.Cells(i - 1, 12) = "TRS" Then
s9.PrintOut
End If
If s2.Cells(i - 1, 12) = "ROV" Then
s10.PrintOut
End If
If s2.Cells(i - 1, 12) = "KÜRE" Then
s7.PrintOut
End If
If s2.Cells(i - 1, 13) = "KAP" Then
s8.PrintOut
End If
If s2.Cells(i - 1, 13) = "ROV" Then
s10.PrintOut
End If
If s2.Cells(i - 1, 13) = "CNC" Then
s5.PrintOut
End If
If s2.Cells(i - 1, 14) = "KAP" Then
s8.PrintOut
End If
End Sub
Sub TEMİZLE()
Unload Me
ÜRETİM.Show
End Sub
Ekli dosyalar
-
63.9 KB Görüntüleme: 18