Mistři v programování na #hovnokod

Visual Basic #545

i = 2

                X = "blank"
                index = ""
                qty = "1"

                For Each Z In sContents
                    If (Z.StartsWith("1") Or Z.StartsWith("2") Or Z.StartsWith("3") Or Z.StartsWith("4") Or Z.StartsWith("5") Or Z.StartsWith("6") Or Z.StartsWith("7") Or Z.StartsWith("8") Or Z.StartsWith("9")) Then
                        Line = Z.Split("|")

                        If Not Line(0).Contains(".") Then
                            index = Line(0)
                            qty = 1
                        End If

                        If Line(1).StartsWith("ID") Then
                            X = Line(3).Substring(15)
                            qty = Line(4)
                        Else
                            sheet.Cells(i, 1) = Line(2)
                            sheet.Cells(i, 2) = Line(3)

                            If Line(2) = X Then
                                sheet.Range("B" & i).Font.Bold = True
                            Else
                                If Line(0).StartsWith(index & ".") Then
                                    sheet.Range("B" & i).IndentLevel() = 1
                                End If
                            End If

                            If Not Line(0).Contains(".") Then
                                sheet.Range("B" & i).Font.Bold = True
                            End If

                            If Line(5) = "N/A" Then
                                sheet.Cells(i, 3) = 0
                            Else
                                sheet.Cells(i, 3) = Line(5)
                            End If

                            sheet.Range("C" & i).NumberFormat = "[$$-2409]#,##0.00"

                            sheet.Cells(i, 4) = Line(7)

                            If qty > 1 Then
                                sheet.Cells(i, 5) = Line(4) * qty
                            Else
                                sheet.Cells(i, 5) = Line(4)
                            End If

                            sheet.Cells(i, 6) = "=E" & i & "*C" & i

                            sheet.Range("F" & i).NumberFormat = "[$$-2409]#,##0.00"

                            sheet.Range("D" & i, "E" & i).HorizontalAlignment = Excel.Constants.xlCenter
                            sheet.Range("A" & i, "F" & i).Font.Size = 10
                            sheet.Range("A" & i, "F" & i).Borders.LineStyle = Excel.Constants.xlSolid

                            i = i + 1
                        End If
                    End If

                Next Z

HovnoKod,