Dear Friends,
I would like to write a macro that fills the cells in a table in word doc.
I have worked in excel but unaware of doing the same in word doc.
Please help me out with this. thanks in advance.
regards
yeshwant
Dear Friends,
I would like to write a macro that fills the cells in a table in word doc.
I have worked in excel but unaware of doing the same in word doc.
Please help me out with this. thanks in advance.
regards
yeshwant
Your request is so broad as to be meaningless. Fill the table with what and from where?
Here's a basic demo that simply inserts the address of each cell in the first table in the document into the cell concerned.
Sub Demo() Dim oCell As Cell With ActiveDocument.Tables(1).Range For Each oCell In .Cells With oCell If .ColumnIndex > 26 Then .Range.Text = Chr(64 + Int(.ColumnIndex / 26)) & Chr(64 + (.ColumnIndex Mod 26)) & .RowIndex Else .Range.Text = Chr(64 + .ColumnIndex) & .RowIndex End If End With Next End With End Sub
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
thanks a lot paul.
it helped a lot !!
regards
yeshwant
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks