Search in first column in table
I have many table in a document. I want to search input data (stored in variable with input box) in first column of all the table and paste a variable data (stored in variable with input box) in the third column after text in the same row. I want to do the search & input data for multiple text one after another as many as.
My trying code
Dim FirstName As String
FirstName = InputBox("Type text", "")
Dim LastName As String
LastName = InputBox("Search BD No", "")
Selection.Find.ClearFormatting
With Selection.Find
.Text = LastName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=FirstName
End Sub
|