Alttaki gibi, E sütununda tam isim listesi, D sütununda ise eksik isim listesi (harf sıralı) var.
a1 a1
a3 a2
b1 a3
b3 b1
c1 b2
c3 b3
c1
c2
c3
Eksik listeye hücre ekleyerek isimleri aynı hizaya getirmek istiyorum. Alttaki gibi işlemler mi olmalı? Şimdiden teşekkürler.
a1 a1
a2
a3 a3
b1 b1
b2
b3 b3
c1 c1
c2
c3 c3
Set s2 = Sheets("Sayfa2")
Dim Son As Long
Son = Range("d" & Rows.Count).End(xlUp).Row 'd sütununun son dolu satırı
Cells(Son, "d").Select
For i = Son To 2 Step -1
If s2.Cells(i, 4) <> s2.Cells(i, 5) Then
ActiveCell.Offset(-1, 0).Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Select
End If
Next i
a1 a1
a3 a2
b1 a3
b3 b1
c1 b2
c3 b3
c1
c2
c3
Eksik listeye hücre ekleyerek isimleri aynı hizaya getirmek istiyorum. Alttaki gibi işlemler mi olmalı? Şimdiden teşekkürler.
a1 a1
a2
a3 a3
b1 b1
b2
b3 b3
c1 c1
c2
c3 c3
Set s2 = Sheets("Sayfa2")
Dim Son As Long
Son = Range("d" & Rows.Count).End(xlUp).Row 'd sütununun son dolu satırı
Cells(Son, "d").Select
For i = Son To 2 Step -1
If s2.Cells(i, 4) <> s2.Cells(i, 5) Then
ActiveCell.Offset(-1, 0).Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Select
End If
Next i