Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Fill a word form clicking on an excel cell
Hi all,
I would like to be able to fill a word form from an excel sheet by clicking on a cell and transferring the data from the different cells of the row in a word document. example : Excel sheet : Name1 address1 code1 city1 Name2 address2 code2 city2 I click on the cell Name1 and may be active a macro or a specific button to get my word document filled with the information. I know how to insert cells into a word document, but I would like to have an automation when I click on a row or on a cell. I'm not aware about programming so it could be great if the solution was very easy to set up. Thanks a lot |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Fill a word form clicking on an excel cell
Hi Denis,
You could use a SelectionChange event-driven macro attached to the relevant worksheet. The following example populates an array with the contents of columns A:D for the current row if any of the cells in A1:A10 is selected. It then outputs those values via a message box. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim i As Integer Dim MyStr(3) If Intersect(Target, ActiveSheet.Range("A1:A10")) Is Nothing Then Exit Sub For i = 0 To 3 MyStr(i) = Target.Cells(1, i + 1).Value Next MsgBox Join(MyStr(), vbCrLf) End Sub -- Cheers macropod [MVP - Microsoft Word] "Denis" wrote in message ... Hi all, I would like to be able to fill a word form from an excel sheet by clicking on a cell and transferring the data from the different cells of the row in a word document. example : Excel sheet : Name1 address1 code1 city1 Name2 address2 code2 city2 I click on the cell Name1 and may be active a macro or a specific button to get my word document filled with the information. I know how to insert cells into a word document, but I would like to have an automation when I click on a row or on a cell. I'm not aware about programming so it could be great if the solution was very easy to set up. Thanks a lot |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening files by double clicking takes for ever - Word, Excel | Setting up and Configuration of Excel | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
How do I put my information form Excel into a Word Merge Form? | Excel Discussion (Misc queries) | |||
Is there a way to convert a EXCEL form into a WORD form? | Excel Discussion (Misc queries) | |||
Is there a way to convert a EXCEL form into a WORD form? | Excel Discussion (Misc queries) |