score:36

Accepted answer

if you want to just shift everything down you can use:

rows(1).insert shift:=xlshiftdown

similarly to shift everything over:

columns(1).insert shift:=xlshiftright

score:2

sub addrisk()

dim ractive as range
dim count_id_column as long

set ractive = activecell

application.screenupdating = false

with thisworkbook.sheets(1) 'change to "sheetname" or sheetindex
    for i = 1 to .range("a1045783").end(xlup).row
        if 'something'  = 'something' then
            .range("a" & i).entirerow.copy 'add thisworkbook.sheets(index_of_sheet) if you copy from another sheet
            .range("a" & i).entirerow.insert shift:= xldown 'insert and shift down, can also use xlup
            .range("a" & i + 1).entirerow.paste 'paste is all, all other defs are less.
            'change i to move on to next row (will get + 1 end of iteration)
            i = i + 1
        end if

            on error resume next
                .specialcells(xlcelltypeconstants).clearcontents
            on error goto 0

        end with
    next i
end with

application.cutcopymode = false
application.screenupdating = true 're-enable screen updates

end sub

Related Query

More Query from same tag