Excel changing the view - Microsoft Community


i have spreadsheet numbers shown, separated commas in 1 column.  don't know if word normalize, data changed separated commas listed alone in cell.  wind single row each number.  hope question understandable.  here picture of looks now:

excel has built-in feature split data separate columns, example in row 2, you'd 1 number each in c2, d2, e2, f2, g2 , h2.

but there no built-in way split data separate rows. need macro that:

sub splitdata()
    dim r long
    dim m long
    dim variant
    dim long
    application.screenupdating = false
    m = range("a" & rows.count).end(xlup).row
    r = m 2 step -1
        = split(range("c" & r).value, ", ")
        if ubound(a) > 0 then
            = ubound(a) 1 step -1
                range("a" & r).entirerow.copy
                range("a" & r + 1).entirerow.insert
                range("c" & r + 1).value = a(i)
            next i
            range("c" & r).value = a(0)
        end if
    next r
    application.cutcopymode = false
    application.screenupdating = true
end sub



Office / Excel / Windows 10 / Office 2016



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