Excel Formula - Microsoft Community


i'm trying figure out formula insert blank row every time number changes in specific column.

i have large spreadsheet , 1 column is order numbers & need insert blank row every time order number changes.

i can right click & "insert" tedious.

thanks help. 

you can't formula; need macro purpose.

change 2 constants @ beginning of following macro, run it:

sub insertrows()
    const datacol = "f" ' column on split
    const firstrow = 2 ' first row at
    dim currow long
    dim lastrow long
    application.screenupdating = false
    lastrow = range(datacol & rows.count).end(xlup).row
    currow = lastrow firstrow step -1
        if range(datacol & currow).value <> range(datacol & (currow - 1)).value then
            range(datacol & currow).entirerow.insert
        end if
    next currow
    application.screenupdating = true
end sub



Office / Excel / Windows 10 / Office 2010



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community