Skip to main content

AccessTr.neT


Userform_ınitialize Sorunu

Userform_ınitialize Sorunu

#8
Dahada yapamazsanız
Function bubble_sort(cmbo As MSForms.ComboBox)

Dim x As Integer, y As Integer

Application.ScreenUpdating = False
    With cmbo
        For x = LBound(.List) To UBound(.List)
          For y = x To UBound(.List)
                If .List(x, 0) > .List(y, 0) Then
                    temp = .List(y, 0)
                    .List(y, 0) = .List(x, 0)
                    .List(x, 0) = temp
                End If
            Next y
        Next x
    End With

Application.ScreenUpdating = True

End Function
Bu kodu ekleyin userform1e.Attaki gibide değiştirin initializeyi.

Private Sub UserForm_Initialize()

  'ComboBox3.MatchEntry = fmMatchEntryComplete
  Dim dic As Object
  Set dic = CreateObject("Scripting.Dictionary")

    For i = 7 To [d65536].End(3).Row
          dic(CStr(Cells(i, 4))) = dic(CStr(Cells(i, 4)))
    Next
ComboBox3.Clear

If dic.Count > 0 Then
    For Each Key In dic.keys
    ComboBox3.AddItem Key
   
    Next
    Call bubble_sort(Me.ComboBox3)
End If
Set dic = Nothing

'TextBox1.Text = CDate(Date) 'Form Açyly?ta otomatik tarih
ListBox1.ColumnCount = 12
ListBox1.ColumnWidths = "20;55;60;140;65;65;65;65;65;65;65;65"
ListBox1.ColumnHeads = True
ListBox1.RowSource = "A7:L" & [A65536].End(3).Row + 1

ComboBox1.RowSource = "Liste!l1:l2"
On Error Resume Next
TextBox21.Text = [e2]
TextBox22.Text = [e4]
TextBox23.Text = [e5]
TextBox60.Text = [C4]
TextBox61.Text = [C5]
TextBox29.Text = [a1]
TextBox24.Text = [G1]
TextBox25.Text = [G2]
TextBox27.Text = [G3]
TextBox63.Text = [G5]
TextBox62.Text = [I1]
TextBox64.Text = [I5]
TextBox65.Text = [K4]
TextBox95.Text = [H4]
TextBox82.Text = [I2]

'ComboBox1_Change
TextBox21 = Format(TextBox21, "#,##0.00")
TextBox22 = Format(TextBox22, "#,##0.00")
TextBox23 = Format(TextBox23, "#,##0.00")
TextBox60 = Format(TextBox60, "#,##0.00")
TextBox61 = Format(TextBox61, "#,##0.00")
TextBox24 = Format(TextBox24, "#,##0.00")
TextBox25 = Format(TextBox25, "#,##0.00")
TextBox27 = Format(TextBox27, "#,##0.00")
TextBox63 = Format(TextBox63, "#,##0.00")
TextBox62 = Format(TextBox62, "#,##0.00")
TextBox64 = Format(TextBox64, "#,##0.00")
TextBox65 = Format(TextBox65, "#,##0.00")
TextBox95 = Format(TextBox95, "#,##0.00")
TextBox82 = Format(TextBox82, "#,##0.00")
If LCase(ActiveSheet.Name) = "sayfa1" Or LCase(ActiveSheet.Name) = "liste" Or LCase(ActiveSheet.Name) = "?ABLON" Then
    ListBox1.Clear
    Exit Sub
End If
End Sub

Alttaki yeri yaptım sadece initalizede.

Kod:
Dim dic As Object
  Set dic = CreateObject("Scripting.Dictionary")

    For i = 7 To [d65536].End(3).Row
          dic(CStr(Cells(i, 4))) = dic(CStr(Cells(i, 4)))
    Next
ComboBox3.Clear

If dic.Count > 0 Then
    For Each Key In dic.keys
    ComboBox3.AddItem Key
   
    Next
    Call bubble_sort(Me.ComboBox3)
End If
Set dic = Nothing

Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Userform_ınitialize Sorunu - Yazar: m_demir - 19/05/2020, 22:08
RE: Userform_ınitialize Sorunu - Yazar: feraz - 19/05/2020, 23:55
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 19/05/2020, 23:59
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:06
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:14
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:18
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:23
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:25
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:29
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:33
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:37
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:39
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:44
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:46
RE: Userform_ınitialize Sorunu - Yazar: m_demir - 20/05/2020, 00:47
RE: Userform_ınitialize Sorunu - Yazar: berduş - 20/05/2020, 00:51
RE: Userform_ınitialize Sorunu - Yazar: feraz - 20/05/2020, 00:57
RE: Userform_ınitialize Sorunu - Yazar: berduş - 20/05/2020, 01:03