Below Code is working only for one cell,I want to change this to "If a particular cell is double-clicked automatically transfer the entire row data into the corresponding word bookmarks"
Sub test()
Dim objWord As Object
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "C:\test.docx" ' change as required
With objWord.ActiveDocument
.Bookmarks("Text1").Range.Text = ws.Range("A1").Value
.Bookmarks("Text2").Range.Text = ws.Range("A2").Value
.Bookmarks("Text3").Range.Text = ws.Range("A3").Value
End With
Set objWord = Nothing
End Sub
I was tried many combinations it was not working,Please help me .........
Sub test()
Dim objWord As Object
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "C:\test.docx" ' change as required
With objWord.ActiveDocument
.Bookmarks("Text1").Range.Text = ws.Range("A1").Value
.Bookmarks("Text2").Range.Text = ws.Range("A2").Value
.Bookmarks("Text3").Range.Text = ws.Range("A3").Value
End With
Set objWord = Nothing
End Sub
I was tried many combinations it was not working,Please help me .........