DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
önünde harf olan rakamları kod ile sıralatmak yasaktır !
Sub SeciliAlanSIRALA()
Dim Adres As String
Dim i As Long
Dim j As Integer
Dim Hucre As Range
If Selection.Count = 1 Then
MsgBox "Birden Fazla Hücre Seçiniz...."
Exit Sub
End If
Adres = Selection.Cells(1, 1).Address
For Each Hucre In Selection
i = i + 1
Cells(i, Columns.Count - 2) = Hucre.Value
If IsNumeric(Hucre.Value) Then
Cells(i, Columns.Count - 1) = Hucre.Value
Cells(i, Columns.Count) = Hucre.Value
Else
j = 0
Do
j = j + 1
Loop While IsNumeric(Mid(Hucre.Value, j, 1)) Or j = Len(Hucre.Value)
Cells(i, Columns.Count - 1) = Left(Hucre.Value, j)
Cells(i, Columns.Count) = Right(Hucre.Value, Len(Hucre) - j)
End If
Next Hucre
Range(Cells(1, Columns.Count - 2), Cells(i, Columns.Count)).Sort Key1:=Cells(1, Columns.Count - 1), Key2:=Cells(1, Columns.Count)
Range(Cells(1, Columns.Count - 2), Cells(i, Columns.Count - 2)).Copy Range(Adres)
Range(Cells(1, Columns.Count - 2), Cells(i, Columns.Count)).Clear
End Sub
tekrar inceledim bir sutun içindekileri seçersek hiçbirsorun yok birden fazla sutun içindekileri seçersek 1. sutun hariç diğer sutundakileri sıralayarak 1. sutuna taşıyor. seçtiğim alanlardaki sayıları aynı alanlara sıralaması gerekiyor.
Sub SeciliAlanSIRALA()
Dim Adres As String
Dim i As Long
Dim j As Integer
Dim Adt As Long
Dim Sat As Long
Dim Kol As Integer
Dim Hucre As Range
If Selection.Count = 1 Then
MsgBox "Birden Fazla Hücre Seçiniz...."
Exit Sub
End If
Application.ScreenUpdating = False
Adres = Selection.Cells(1, 1).Address
Sat = Range(Adres).Row
Kol = Range(Adres).Column
Adt = Selection.Rows.Count
For Each Hucre In Selection
i = i + 1
Cells(i, Columns.Count - 2) = Hucre.Value
If IsNumeric(Hucre.Value) Then
Cells(i, Columns.Count - 1) = Hucre.Value
Cells(i, Columns.Count) = Hucre.Value
Else
j = 0
Do
j = j + 1
Loop While IsNumeric(Mid(Hucre.Value, j, 1)) Or j = Len(Hucre.Value)
Cells(i, Columns.Count - 1) = Left(Hucre.Value, j)
Cells(i, Columns.Count) = Right(Hucre.Value, Len(Hucre) - j)
End If
Next Hucre
Selection.ClearContents
Range(Cells(1, Columns.Count - 2), Cells(i, Columns.Count)).Sort Key1:=Cells(1, Columns.Count - 1), Key2:=Cells(1, Columns.Count)
For i = 1 To Cells(Rows.Count, Columns.Count - 2).End(3).Row Step Adt
Range(Cells(i, Columns.Count - 2), Cells(i + Adt - 1, Columns.Count - 2)).Copy Cells(Sat, Kol)
Kol = Kol + 1
Next i
Range(Cells(1, Columns.Count - 2), Cells(i, Columns.Count)).Clear
Application.ScreenUpdating = True
MsgBox "SIRALAMA BİTMİŞTİR....", vbInformation, "N. YEŞERTENER --> [URL="http://www.excel.web.tr/"]www.excel.web.tr[/URL]"
End Sub
çok teşekkür ediyorum tam istediğim gibi olmuş ellerinize sağlık