Scott Torocco
Scott Torocco

Reputation: 21

Create new column pulling one word from description column in Excel

I have a column that is labeled "Accident Description" and the cell(s) describe an incident/accident. For example, "Rib injury when descending ladder and slipped and fell between 5 and 10 feet"

I want to pull the word "Rib" and add it to a new column titled "Body Part" and would like to add another column labeled "Source" and add the word "Ladder" to the source column.

It will run and create a new column but stops there.

Sub Claims_Analysis()

Claims_Analysis Macro
Claims Analysis Steps
Columns("J:J").Select
Selection.AutoFilter
ActiveSheet.Range("$J$1:$J$2500").AutoFilter Field:=1, Criteria1:=Array( _
 "PWC", "WCP", "WCV"), Operator:=xlFilterValues

Add_Column Macro
Columns("K:K").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

Macro to replace word in Accident Description Column

Private Sub Worksheet_Change(ByVal Target As Range)
If InStr(Target.Value, "Rib") Then
Target.Offset(, 1).Value = "Rib"
End If

End Sub

End Sub

Upvotes: 0

Views: 18

Answers (0)

Related Questions