önce bir modüle aşağıdaki fonksiyonu ekleyip
Option Compare Text
Function SortArrayAtoZ(myArray As Variant)
Dim i As Long
Dim j As Long
Dim Temp
'Sort the Array A-Z
For i = LBound(myArray) To UBound(myArray) - 1
For j = i + 1 To UBound(myArray)
If UCase(myArray(i)) > UCase(myArray(j)) Then
Temp = myArray(j)
myArray(j) = myArray(i)
myArray(i) = Temp
End If
Next j
Next i
SortArrayAtoZ = myArray
End Function
sonra da form başlangıç kodunu aşağıdaki gibi düzenleyip dener misiniz?Private Sub UserForm_Initialize()
Dim sonTabloSatr As Long
Dim Rng As Range
With ThisWorkbook.Sheets("Ana_Sayfa")
sonTabloSatr = .ListObjects("Tablo1").Range.Columns(1).Cells.Find("*", _
SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious).Row
If sonTabloSatr = 2 Then
ComboBox_FirmaUnvani.AddItem .Range("C2").Value
ElseIf sonTabloSatr > 2 Then
Set Rng = .Range("C2:C" & sonTabloSatr)
Dim arr() As Variant
x = -1
For Each a In Rng.Cells
ReDim Preserve arr(x + 1)
x = x + 1
arr(x) = a.Value
Next
End If
End With
ComboBox_FirmaUnvani.List = SortArrayAtoZ(arr)
Application.AutoCorrect.AutoExpandListRange = True
IlleriAktar
TextBox_Tarih = Format(Date, "dd.mm.yyyy")
With TextBox_Tarih
.SelStart = 0
.SelLength = .TextLength
End With
End Sub