Results 1 to 6 of 6

Thread: Auto-populate a MS Word table cell with text from a diff cell?

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    question Auto-populate a MS Word table cell with text from a diff cell?

    I have a table with three columns. Is it possible to "program" the cells of the 2nd and 3rd columns to contain exactly the same text from the cells of the 1st column? I'm looking for a way to do this without copying and pasting. The 1st column will be updated frequently, and the 2nd and 3rd need to automatically update themselves to match. Is this something I would use cell References for? I'm unfamiliar with how they work. Thanks.

  2. #2
    Join Date
    May 2008
    Posts
    4,831

    Re: Auto-populate a MS Word table cell with text from a diff cell?

    However, to pull data from another table based on a user's selection, you would often use a recordset:

    Dim rst As ADODB.Recordset

    Set rst = New ADODB.Recordset
    rst.Open "SELECT Name, Serial, Contact FROM Borrowers WHERE Name='" & Me.YourSearchBox & "'", CurrentProject.connection

    IF Not(rst.EOF and rst.BOF) Then
    Me.ctlName = rst("Name")
    Me.ctlSerial= rst("Serial")
    Me.ctlContact=rst("Contact")
    End If

    Set rst = Nothing

    Of course, you'll need to change the names of your controls (the Me.ctlName, etc) to match your project.

    Also, "Name" is a reserved word in Access.

  3. #3
    Join Date
    May 2008
    Posts
    4,570

    Re: Auto-populate a MS Word table cell with text from a diff cell?

    You can follow the follwoing step to copy 1st column to 2nd & 3rd with futher assistence.....!

    1. First fill the first column with the data you want.
    2. Then select the column till there that you want to copy to other column.
    3. Then move your mouse to the right end corner of the selected part of column.
    4. You will see the black mini box at the select right down corner of the column .
    5. Click & drag left mouse button to the columns you want to copy that same content.

    Was this helpfull to you REPLY....!

  4. #4
    Join Date
    May 2008
    Posts
    4,570

    Re: Auto-populate a MS Word table cell with text from a diff cell?

    Select the cell B1 which contains the formula =C1+D1. Highlight the formula in the formula bar and enter Ctrl+C to copy the formula to the clipboard. Leave the formula bar by pressing Esc or Enter or Cancel (clicking the X to the left of fx on the formula bar).

    Select cell D3 and press Ctrl+V to paste the formula into cell D3.

  5. #5
    Join Date
    May 2008
    Posts
    4,345

    Re: Auto-populate a MS Word table cell with text from a diff cell?

    You can try this method - the method simply performs copy and paste using VBA code.
    Consider the sample code - the code finds the last row in Column A and copies the cell to L1. You can change it acoording to your needs accordingly...

    Code:
    Private Sub Workbook_Open() 
         
        Range("A1").End(xlDown).Select 
        Selection.Copy 
        Range("L1").Select 
        ActiveSheet.Paste 
        Range("A1").Select 
        Application.CutCopyMode = False 
        UserForm.Show 
         
    End Sub
    This codes runs as soon as the worksheet opens and it has worked for over a year.

  6. #6
    Join Date
    Mar 2009
    Posts
    2

    star Re: Auto-populate a MS Word table cell with text from a diff cell?

    Thanks for your replies, guys, but most of what you've suggested goes way over my head. I received a couple different suggestions in another forum, that have successfully solved my problem.
    Last edited by Yogesh; 24-03-2009 at 08:31 AM. Reason: External link removed

Similar Threads

  1. Applying absolute cell referencing to many cell in Excel
    By Nyota in forum MS Office Support
    Replies: 2
    Last Post: 24-02-2012, 07:23 PM
  2. Replies: 2
    Last Post: 17-02-2012, 08:09 PM
  3. Replies: 2
    Last Post: 04-01-2012, 06:54 PM
  4. Replies: 1
    Last Post: 09-09-2011, 03:38 PM
  5. How to populate a merged cell from a form in excel
    By SoConfused in forum Windows Software
    Replies: 1
    Last Post: 09-06-2009, 08:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,643,346,443.90307 seconds with 17 queries