Please try the following:
1. In each parts sheet, select cell A1 and under Alignment, unselect Wrap Text (needed for proper formatting by the code).
2. Delete any worksheets other than the parts sheets and the product index sheet. If this is not desirable, a code adjustment will be needed.
3. Replace the product index Worksheet_Activate code with the following:
Private Sub Worksheet_Activate()
Dim sh As Worksheet, rw As Long, endrw As Long, OMRw As Long
If MsgBox("Rebuild Parts Index?", vbYesNo, "Parts Index") <> vbYes Then Exit Sub
Application.ScreenUpdating = False
rw = Cells.SpecialCells(xlCellTypeLastCell).Row
Rows("2:" & rw).Delete
OMRw = 2
For Each sh In ActiveWorkbook.Sheets
With sh
If .Name <> ActiveSheet.Name Then
If .Range("E" & .Rows.Count).End(xlUp).Row > 2 Then ' There are included parts on this sheet
.Range("A1").Copy Cells(OMRw, 1) ' Section name
Range(Cells(OMRw, 1), Cells(OMRw, 3)).VerticalAlignment = xlCenter
Range(Cells(OMRw, 1), Cells(OMRw, 3)).MergeCells = True
.Range("A2:C2").Copy Cells(OMRw + 1, 1) ' Section headings
OMRw = OMRw + 2
endrw = .Range("A" & .Rows.Count).End(xlUp).Row
For rw = 3 To endrw
If .Cells(rw, 5).Value <> "" Then ' Selected part
.Range(.Cells(rw, 1), .Cells(rw, 3)).Copy Cells(OMRw, 1)
OMRw = OMRw + 1
End If
Next
OMRw = OMRw + 1
End If
End If
End With
Next
End Sub
Bookmarks