This does the copy paste and highlights the word as I require so thanks once again
Next question though is I only want to copy the rows that contain the data I am searching for, and there may be several rows containing this data. I can think of a way of doing this by copying the data to a temp sheet first before exporting it but im sure there must be an easier way
Any Ideas?
Option Explicit
Sub Macro1()
Dim Cel As Range
Dim WS As Worksheet
Dim FirstAddress As String
Set WS = ThisWorkbook.Sheets("Sheet1")
With WS.Cells
Set Cel = .Find(What:="Test", LookIn:=xlValues, _
LookAt:=xlPart, MatchCase:=True)
If Not Cel Is Nothing Then
FirstAddress = Cel.Address
Do
'Cel.Interior.ColorIndex = 5
Set Cel = .FindNext(Cel)
Loop While Not Cel Is Nothing And Cel.Address <> FirstAddress
End If
End With
Call PasteToWord
End Sub
Sub PasteToWord()
Dim AppWord As Word.Application
Set AppWord = CreateObject("Word.Application")
AppWord.Visible = True
' Change the range to suit your needs. See the How to Use for this code
Sheets("Sheet1").Range("A1:A40").Copy
AppWord.Documents.Add
AppWord.Selection.Paste
AppWord.Selection.Find.ClearFormatting
AppWord.Selection.Find.Replacement.ClearFormatting
With AppWord.Selection.Find
.Text = "test"
.Replacement.Font.Name = "Arial Black"
.Replacement.Font.Color = wdColorRed
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
AppWord.Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Thanks Again