try this code:
Sub PARTSLISTBOM()
'
' PARTSLISTBOM Macro
' FORMAT PARTS LIST BOM
' DELETES P AND R NUMBERS
' Keyboard Shortcut: Ctrl+Shift+P
'
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").EntireColumn.AutoFit
Columns("D:D").EntireColumn.AutoFit
Columns("E:E").EntireColumn.AutoFit
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").Select
Selection.Delete Shift:=xlToLeft
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("G1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "SKID#"
Range("H1").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = "LOCATION"
Range("H2").Select
Columns("G:G").EntireColumn.AutoFit
Columns("H:H").EntireColumn.AutoFit
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.ColumnWidth = 11.57
Range("A1").Select
ActiveCell.FormulaR1C1 = "OLD PART"
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.RowHeight = 38.25
Range("A1:J1").Select
Columns("J:J").EntireColumn.AutoFit
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("B:B,C:C,E:E").Select
Range("E2").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Range("F4").Select
ActiveWindow.SmallScroll Down:=-9
Range("B3").Select
Dim last As Long
Dim x As Long
last = Cells(Rows.Count, "e").End(xlUp).Row
For x = last To 3 Step -1
If Cells(x, 5).Value Like "P*" Or Cells(x, 5).Value Like "R*" Or Cells(x, 5).Value Like "C*" Then
Cells(x, 5).EntireRow.Delete
End If
Next
Call aaa
End Sub
Sub aaa()
Dim LastD As Long, x As Long
Dim cell As Variant
LastD = Cells(Rows.Count, "e").End(xlUp).Row
For Each cell In Range("b3:b" & LastD)
x = x + 1
cell.Value = x
Next
End Sub
Bookmarks