sub macro1() dim a as variant dim h as range dim r as long dim w0 as worksheet set w0 = activesheet worksheets.add after:=w0 r = 1 range("A1:G1") = array("苗字","名前","住所","TEL","〒","好きなスポーツ","性別") on error resume next for each h in w0.range("A1:A" & w0.range("A65536").end(xlup).row) if h <> "" then a = split(replace(application.trim(replace(replace(h, " "," "),":",":")),": ",":"), " ") r = r + 1 cells(r, "A") = split(a(0), ":")(1) cells(r, "B") = split(a(1), ":")(1) cells(r, "C") = split(a(2), ":")(1) cells(r, "D") = split(a(3), ":")(1) cells(r, "E") = split(a(4), ":")(1) cells(r, "F") = a(5) cells(r, "G") = a(6) end if next end sub
↧