19 Nisan 2017 Çarşamba

Excel VBA - sütundaki verilerin tümünü işlemek

Her satır arasına boş bir satır ekleyen kodlama için aşağıda yer alan döngü türlerini inceleyiniz.


Sub dongu1()
 ' HER SATIRDAN SONRA bir satır boş satır ekelenecek.
Dim satir As Integer

For satir = 1 To Range("A" & Rows.Count).End(xlUp).Row

If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If

Next

End Sub


Sub Dongu2()
' FC sheet HER SATIRDAN SONRA bir satır boş satır ekelenecek.
Dim satir As Integer
satir = 1

For Each cell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)

If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If

satir = satir + 1

Next

End Sub

Sub dongu3()
' FC sheet HER SATIRDAN SONRA bir satır boş satır ekelenecek.


Dim satir As Integer
satir = 1

Do
If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If

satir = satir + 1

Loop Until Cells(satir, 1).Value = ""

End Sub



Sub Dongu4()
 ' FC sheet HER SATIRDAN SONRA bir satır boş satır ekelenecek.
Dim satir As Integer

For satir = 1 To Range("A1", Range("A1").End(xlDown)).Rows.Count

If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If

Next

End Sub


Sub Dongu5()
' FC sheet HER SATIRDAN SONRA bir satır boş satır ekelenecek.
Dim satir As Integer

For satir = 1 To Range("A1048576").End(xlUp).Row

If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If

Next


End Sub
Sub Dongu6()
' FC sheet HER SATIRDAN SONRA bir satır boş satır ekelenecek.
Dim satir As Integer


For satir = 1 To Range("A1").End(xlDown).Row
If satir Mod 2 Then
' yeni satır ekle
Rows(satir).EntireRow.Insert
End If
Next


End Sub

Hiç yorum yok:

Yorum Gönder