Excel Insert Row after 4 Rows
Closed
Cthomp
-
6 Jul 2010 à 12:10
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 6 Jul 2010 à 18:45
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 6 Jul 2010 à 18:45
Related:
- Excel Insert Row after 4 Rows
- Fan xpert 4 download - Download - Cleaning and optimization
- Saints row 2 cheats - Guide
- Pluraleyes 4 - Download - Video editing
- Diablo 4 full torrent - Download - Role playing
- How to delete a row in word - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
6 Jul 2010 à 18:45
6 Jul 2010 à 18:45
That will not do for you. In that the objective was to move row into columns. You want to add a row after every fourth row
Sub AddBlankRow()
Dim Cell As Range
Dim sTgtSht As String
Dim lMaxRows As Long
Dim lRow As Long
sTgtSht = "Sheet1"
Set Cell = Sheets(sTgtSht).Cells.Find("*", Cells(1, 1), SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
If Cell Is Nothing Then GoTo End_Sub
lMaxRows = Cell.Row
Set Cell = Nothing
For lRow = 5 To lMaxRows Step 5
Sheets(sTgtSht).Rows(lRow).Insert
lMaxRows = lMaxRows + 1
Next lRow
End_Sub:
End Sub