ockucukay
Altın Üye
- Katılım
- 29 Aralık 2005
- Mesajlar
- 862
- Excel Vers. ve Dili
- Office 365 Türkçe
- Altın Üyelik Bitiş Tarihi
- 02-07-2025
forumdan (sayın tankut sazlı'nın çalışması) aldığım bir örneği değerlendirerek userformumu minimize etmeye çalışıyorum. ancak daha önce sorunsuz çalışan formum, bu kodları ekleyince aşağıdaki satırda "variable not defined" hatası veriyor, ne yapmam lazım?
Private Sub UserForm_initialize()
Application.ScreenUpdating = False
Sheets("DATABASE").Activate
On Error Resume Next
ALAN01.SetFocus
Sheets("MUSTERI").Select
Call Firma_Adı_Güncelle
ALAN02.RowSource = "SÜZ!A1:A" & Sheets("SÜZ").Range("A65536").End(xlUp).Row
Application.ScreenUpdating = True
'For a = 2 To [b65536].End(3).Row
'If WorksheetFunction.CountIf(Sheets("MUSTERI").Range("b2:b" & a), Cells(a, "b")) = 1 Then ALAN02.AddItem Cells(a, "b")
ALAN03.RowSource = "MUSTERI!c2:c" & Sheets("MUSTERI").[C65536].End(3).Row
ALAN14.RowSource = "YETKILI!k2:k" & Sheets("YETKILI").[k65536].End(3).Row
Call SonKayıt
ActiveCell.Offset(-1, 0).Select
Call EkranKaydet
Call VeriAl
kayıt = False
Application.ScreenUpdating = False
ALAN01.Value = Empty
ALAN02.Value = Empty
ALAN03.Value = Empty
ALAN04.Value = Empty
ALAN05.Value = Empty
ALAN06.Value = Empty
ALAN07.Value = Empty
ALAN08.Value = Empty
ALAN09.Value = Empty
ALAN10.Value = Empty
ALAN11.Value = Empty
ALAN12.Value = Empty
ALAN13.Value = Empty
ALAN14.Value = Empty
ALAN15.Value = Empty
For k = 1 To Sheets("DATABASE").Cells(65536, 2).End(xlUp).Row 'bu satırda hatayı veriyor
For j = 1 To 16
Spreadsheet1.ActiveSheet.Cells(k, j) = Sheets("DATABASE").Cells(k, j)
If j = 16 And k > 1 Then
With Spreadsheet1.ActiveSheet.Cells(k, j)
.Value = "Bilgi Klasörü"
.Font.ColorIndex = 5
.Font.Underline = xlUnderlineStyleSingle
End With
End If
Next j
Next k
[a1].CurrentRegion.Copy
Spreadsheet1.[a1].Paste
Spreadsheet1.[a].EntireColumn.AutoFit
Application.CutCopyMode = False
Spreadsheet1.[a1].Select
Spreadsheet1.[a11].AutoFilter
Spreadsheet1.ActiveWindow.ViewableRange = "a1" & [A65536].End(3).Row
If Spreadsheet1.Height < 263 Then Spreadsheet1.Height = Spreadsheet1.Range("a1:a" & [A65536].End(3).Row).Height
Spreadsheet1.Width = Spreadsheet1.[a11].Width + 13
'End If
'Next
End Sub
Private Sub UserForm_initialize()
Application.ScreenUpdating = False
Sheets("DATABASE").Activate
On Error Resume Next
ALAN01.SetFocus
Sheets("MUSTERI").Select
Call Firma_Adı_Güncelle
ALAN02.RowSource = "SÜZ!A1:A" & Sheets("SÜZ").Range("A65536").End(xlUp).Row
Application.ScreenUpdating = True
'For a = 2 To [b65536].End(3).Row
'If WorksheetFunction.CountIf(Sheets("MUSTERI").Range("b2:b" & a), Cells(a, "b")) = 1 Then ALAN02.AddItem Cells(a, "b")
ALAN03.RowSource = "MUSTERI!c2:c" & Sheets("MUSTERI").[C65536].End(3).Row
ALAN14.RowSource = "YETKILI!k2:k" & Sheets("YETKILI").[k65536].End(3).Row
Call SonKayıt
ActiveCell.Offset(-1, 0).Select
Call EkranKaydet
Call VeriAl
kayıt = False
Application.ScreenUpdating = False
ALAN01.Value = Empty
ALAN02.Value = Empty
ALAN03.Value = Empty
ALAN04.Value = Empty
ALAN05.Value = Empty
ALAN06.Value = Empty
ALAN07.Value = Empty
ALAN08.Value = Empty
ALAN09.Value = Empty
ALAN10.Value = Empty
ALAN11.Value = Empty
ALAN12.Value = Empty
ALAN13.Value = Empty
ALAN14.Value = Empty
ALAN15.Value = Empty
For k = 1 To Sheets("DATABASE").Cells(65536, 2).End(xlUp).Row 'bu satırda hatayı veriyor
For j = 1 To 16
Spreadsheet1.ActiveSheet.Cells(k, j) = Sheets("DATABASE").Cells(k, j)
If j = 16 And k > 1 Then
With Spreadsheet1.ActiveSheet.Cells(k, j)
.Value = "Bilgi Klasörü"
.Font.ColorIndex = 5
.Font.Underline = xlUnderlineStyleSingle
End With
End If
Next j
Next k
[a1].CurrentRegion.Copy
Spreadsheet1.[a1].Paste
Spreadsheet1.[a].EntireColumn.AutoFit
Application.CutCopyMode = False
Spreadsheet1.[a1].Select
Spreadsheet1.[a11].AutoFilter
Spreadsheet1.ActiveWindow.ViewableRange = "a1" & [A65536].End(3).Row
If Spreadsheet1.Height < 263 Then Spreadsheet1.Height = Spreadsheet1.Range("a1:a" & [A65536].End(3).Row).Height
Spreadsheet1.Width = Spreadsheet1.[a11].Width + 13
'End If
'Next
End Sub