How about
Sub AutoPart()
Dim Rng As Range
Dim X As Range
Set Rng = Application.InputBox(Prompt:="Select a cell.", Title:="X-Axis.", Type:=8)
For Each X In Rng
If X.Offset(0, 12).Value Then 'If a value is present in column M Then
Range(Cells(X.Row, 34).Address) = "P/N Proof" 'insert "P/N Proof" in column AG
End If
If X.Offset(0, 13).Value Then
Range(Cells(X.Row, 34).Address) = "P/N Static Pressure"
End If
If X.Offset(0, 14).Value Then 'If a value is present in column O Then
Select Case X.Offset(0, 1).Value 'Look in column B for one of the following cases:
Case Is = "XYZ"
Range(Cells(X.Row, 34).Address) = "P/N XYZ" 'If Case XYZ insert "P/N XYZ" in column AG
Case Is = "ZXY"
Range(Cells(X.Row, 34).Address) = "P/N ZXY"
Case Is = "YXZ"
Range(Cells(X.Row, 34).Address) = "P/N YXZ"
End Select
End If
If X.Offset(0, 15).Value Then
Select Case X.Offset(0, 1).Value
Case Is = "123"
Range(Cells(X.Row, 34).Address) = "P/N 123"
Case Is = "321"
Range(Cells(X.Row, 34).Address) = "P/N 321"
End Select
End If
If X.Offset(0, 16).Value Then
Select Case X.Offset(0, 1).Value
Case Is = "456"
Range(Cells(X.Row, 34).Address) = "P/N 456"
Case Is = "654"
Range(Cells(X.Row, 34).Address) = "P/N 654"
Case Is = "546"
Range(Cells(X.Row, 34).Address) = "P/N 546"
Case Is = "564"
Range(Cells(X.Row, 34).Address) = "P/N 564"
End Select
End If
Next X
End Sub
Bookmarks