Sub splitCell(beginRowId, endRowId)
Dim begRange, endRange, endRange2
begRange = "A" & beginRowId
endRange = "A" & endRowId
endRange2 = "E" & endRowId
Range(begRange & ":" & endRange).Select
Selection.ClearFormats
Range(begRange & ":" & endRange2).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlDash
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
Selection.NumberFormatLocal = "@"
End Sub
Sub ParseSplitTestId(cellRowId)
'parse id String use "-"
Dim tmpStr, myArr
tmpStr = Cells(cellRowId, 1).Value
myArr = Split(tmpStr, "-", 5)
For intI = 0 To UBound(myArr)
'MsgBox "--" & myArr(intI)
'Range("A" & (cellRowId + intI)).Value = myArr(intI)
Cells(cellRowId, 1 + intI).Value = CStr(myArr(intI))
Next
End Sub
Sub ParseSplitStr(beginRowId, maxRowId)
Dim count, tmpId, tmpStr
count = maxRowId - beginRowId + 1
For intI = 0 To count
tmpId = beginRowId + intI
'tmpStr = Cells(tmpId, 1).Value
'MsgBox (tmpStr = "")
'If tmpStr = "" Then
' Exit For
'End If
ParseSplitTestId (tmpId)
Next
End Sub
Sub ProcessOneFile(filename, maxRowId)
Dim beginRowId
beginRowId = 8
Windows(filename).Activate
Worksheets(2).Select
Call splitCell(beginRowId, maxRowId)
Call ParseSplitStr(beginRowId, maxRowId)
Windows(filename).ActivateNext
MsgBox filename & " - process sucess!"
End Sub