# Delete row in Word in VBA



## mrpman97 (Jul 2, 2011)

I am using a find to select the letters""SCV"
I then want to delete the entire row
The code below only deletes SVC. How can I delete the entire row (line)?

Dim count As Integer
count = 0

Selection.HomeKey unit:=wdStory
With Selection.Find
.ClearFormatting
.Text = "SVC"
.Wrap = wdFindContinue


.Execute
Do While .Found = True


count = count + 1

MsgBox count

    'Selection.Delete unit:=wdCharacter, count:=1
'Selection.MoveRight


'Selection.MoveDown unit:=wdParagraph, count:=1

Selection.Delete

.Execute
Loop
End With
End Sub


----------



## SydneyGeek (Jul 2, 2011)

Try changing this...

```
Selection.Delete unit:=wdCharacter, count:=1
```
...to this

```
Selection.Delete unit:=wdLine, count:=1
```

Denis


----------



## Macropod (Jul 3, 2011)

Hi mrpman97,

Actually, you can do it without a macro, using a _wildcard_ Find/replace, where:
Find = [!^13]@SCV[!^13]{1,}^13
Replace = nothing


----------

