Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening files by double clicking takes for ever - Word, Excel Scott Townsend Setting up and Configuration of Excel 3 July 31st 08 01:17 PM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
How do I put my information form Excel into a Word Merge Form? Jackie Excel Discussion (Misc queries) 2 March 16th 06 09:16 PM
Is there a way to convert a EXCEL form into a WORD form? Sister6 Excel Discussion (Misc queries) 0 April 27th 05 11:35 PM
Is there a way to convert a EXCEL form into a WORD form? Carole O Excel Discussion (Misc queries) 1 April 27th 05 10:13 PM


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"