DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Intersect(Target, Range("a2:a" & [a65536].End(3).Row)) Is Nothing Then Exit Sub
Dim st As Variant
Set st = Range("a" & Target.Row & ":m" & Target.Row)
Application.EnableEvents = False
Rows(Val(Target) + 1).Insert shift:=xlDown
st.Cut Cells(Target + 1, "a")
Range("a2:m" & [a65536].End(3).Row).SpecialCells(xlCellTypeBlanks).Delete
[a2].AutoFill Destination:=Range("a2:a" & [a65536].End(3).Row), Type:=xlFillSeries
Application.CutCopyMode = False
Application.EnableEvents = True
MsgBox "Yeni sıralama yapıldı.", vbInformation, "leumruk"
End Sub
Sn.Meslan,
çok teşekkürler ancak bir sorun var...örnek:1 rakamını 10 yapınca sorun çıkyor ve 2'den başlıyor.
Leumruk hocam sizinkindede öyle.ilk numarayı en sona atamıyorum.
Teşekkürler
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target.Rows, [A2:A65536]) Is Nothing Then Exit Sub
Application.EnableEvents = False
a = 2
If Target.Row = 2 Then a = [A65536].End(3).Row + 1
Rows(Target.Row).Cut
Rows(a).Insert Shift:=xlDown
Range("A2:M" & [A65536].End(3).Row).Sort Range("A2")
For i = 2 To [A65536].End(3).Row
Cells(i, 1).Value = i - 1
Next
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target.Rows, [A2:A65536]) Is Nothing Then Exit Sub
Application.EnableEvents = False
a = 2
If Target.Row = 2 Then a = [A65536].End(3).Row: GoTo 1
Set b = [A:A].Find(Target.Value, LookAt:=xlWhole)
If Not b Is Nothing And b.Row <> Target.Row Then
a = b.Row
Else
Set b = [A:A].FindNext(b)
If Not b Is Nothing Then a = b.Row
End If
1 Rows(Target.Row).Cut
Rows(a + 1).Insert Shift:=xlDown
Range("A2:M" & [A65536].End(3).Row).Sort Range("A2")
For i = 2 To [A65536].End(3).Row
Cells(i, 1).Value = i - 1
Next
Application.EnableEvents = True
End Sub