Hi all:
Looking to format a BOM down-load (into Excel), so that the BOM levels are indented according to the level number.
Levels are indicated in Column C. Columns to indent would be C thru F.
Number of rows is undetermined.
Setting up the code, I have the following - although so far mostly instructions without code.
I hope the requirements are expressed clearly enough.
Sub BomIndentCols()
Dim LastRow As Integer
' Set Columns to be Indented to Default Left Align
Range("C:F").HorizontalAlignment = xlLeft
' Determine Last Row for THIS Spread-Sheet
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
' Go to C, Last Row
Range("C" & LastRow).Select
' If C = Blank, Do Nothing
' If C = 0, Do Nothing
' If C = 1, Indent 2 spaces
' If C = 2, Indent 4 Spaces
' If C = 3, Indent 6 Spaces
' If C = 4, Indent 8 Spaces
' If C = 5, Indent 10 Spaces
' If C = 6, Indent 12 Spaces
' Indent Columns C, D, E & F, In current Row, according to above.
' Move UP one Row, and repeat, Until all completed, or until error
' (Several rows at top will be headings - therefore NOT be blank, or 0 thru 6)
End Sub
Bookmarks