- Katılım
- 24 Nisan 2023
- Mesajlar
- 38
- Excel Vers. ve Dili
- 2016
merhablar
linkteki dosyada
a Sütununda tarih varken sıralama yapıp satırlar arası boşluk oluşturuyor
tarih kısmını b sütununa taşıyınca hata veriyor yardımcı olabilirseniz sevinirim
www.dosya.tc
Sub sirala()
On Error Resume Next
ss = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
If ss < 3 Then Exit Sub
With ActiveSheet
.Sort.SortFields.Clear
.Sort.SortFields.Add Range("A4:A" & ss), xlSortOnValues, xlAscending, xlSortNormal
.Sort.SortFields.Add Range("B4:B" & ss), xlSortOnValues, xlAscending, "deneme3,deneme1,deneme2", xlSortNormal
.Sort.SetRange Range("A4:r" & ss)
.Sort.Apply
End With
ss = Cells(Rows.Count, 1).End(xlUp).Row
If ss < 4 Then Exit Sub
For i = ss - 1 To 4 Step -1
If Month(Cells(i, 1)) <> Month(Cells(i + 1, 1)) Then Rows(i + 1 & ":" & i + 7).Insert Shift:=xlDown
Next i
End Sub
linkteki dosyada
a Sütununda tarih varken sıralama yapıp satırlar arası boşluk oluşturuyor
tarih kısmını b sütununa taşıyınca hata veriyor yardımcı olabilirseniz sevinirim
siralama_-_Kopya__2_.zip dosyasını indir - download
siralama_-_Kopya__2_.zip dosyasını indir, download. Dosya.tc .Dosya Upload. Dosya Paylaş. Dosya Yükle

On Error Resume Next
ss = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
If ss < 3 Then Exit Sub
With ActiveSheet
.Sort.SortFields.Clear
.Sort.SortFields.Add Range("A4:A" & ss), xlSortOnValues, xlAscending, xlSortNormal
.Sort.SortFields.Add Range("B4:B" & ss), xlSortOnValues, xlAscending, "deneme3,deneme1,deneme2", xlSortNormal
.Sort.SetRange Range("A4:r" & ss)
.Sort.Apply
End With
ss = Cells(Rows.Count, 1).End(xlUp).Row
If ss < 4 Then Exit Sub
For i = ss - 1 To 4 Step -1
If Month(Cells(i, 1)) <> Month(Cells(i + 1, 1)) Then Rows(i + 1 & ":" & i + 7).Insert Shift:=xlDown
Next i
End Sub