Hello! I have a document where I would like to change all letters to another spesific based on excel cell value:
I got an error: sub og function not definedSub SelectToBracketsDelete()
Dim j As Integer
For j = 2 To 10
stringReplaced = stringReplaced + "string to be searched"
For Each myStoryRange In ActiveDocument.StoryRanges
With myStoryRange.Find
.Text = workbooks("Bok1.xlsm").Worksheets("Ark1").Cells(j, 2).Value
.Replacement.Text = workbooks("Bok1").Worksheets("Ark1").Cells(j, 3).Value
.Wrap = wdFindContinue
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Highlight = False
.Execute Replace:=wdReplaceAll
End With
Next myStoryRange
Next j
End Sub
I have values in B column that is searched in word. C column is the replacement. Is it also possible to do this only with first sentence(to first .)?
I appreciate any help!
Bookmarks