Forum Discussion

Bjarkiwaage's avatar
Bjarkiwaage
Copper Contributor
Aug 16, 2022
Solved

Excel duplicate line meny at the same time and change the signs in a series of doublings.pervasive

I have excel sheet with 500 lines of data how can i duplicate all lines so that there will be the same data in every two (1 and 2 the same 3 and 4 the same) so instead of 500 lines there are 1000 eve...
  • HansVogelaar's avatar
    Aug 16, 2022

    Bjarkiwaage 

    Run this macro:

    Sub Dup()
        Dim r As Long
        Dim m As Long
        Application.ScreenUpdating = False
        m = Range("A" & Rows.Count).End(xlUp).Row
        For r = m To 1 Step -1
            Range("A" & r).EntireRow.Copy
            Range("A" & r + 1).EntireRow.Insert
        Next r
        Application.CutCopyMode = False
        Application.ScreenUpdating = True
    End Sub

Resources