Sub ilkVeSonKlasor()
Dim son As Long, bul As Integer, bul2 As Integer
Dim txt1 As MSForms.TextBox, txt2 As MSForms.TextBox
Set txt1 = Me.TextBox1
Set txt2 = Me.TextBox2
With Sheets("ANA SAYFA")
son = .Cells(Rows.Count, 1).End(3).Row
If WorksheetFunction.CountA(.Range("A2:A" & Rows.Count)) > 2 Then
txt1.Value = .Cells(4, "A").Value
txt2.Value = .Cells(son - 1, "A").Value
bul = InStr(1, txt1.Value, " ")
bul2 = InStr(1, txt2.Value, " ")
If bul > 0 Then txt1.Value = Mid(txt1.Value, 1, bul - 1) Else txt1.Value = Empty
If bul2 > 0 Then txt2.Value = Mid(txt2.Value, 1, bul2 - 1) Else txt2.Value = Empty
End If
End With
Set txt1 = Nothing
Set txt2 = Nothing
End Sub
ilgili kodu alttaki ile değiştirin.Mantık şöyle;textbox1 ve textbox2 ye bakar ve ilk boş karakterden öncesini alır varsa şaet bolşluk yoksa textbox boş olur.