i have table made in ms word (insert table). As you are working with tables in Word, you may want to fill the various cells in a table with a set value. For instance, you might want to copy something to the Clipboard, and then paste the contents of the Clipboard to each cell in a table. The following macro will do the trick (work properly): i found in this code from google
Code: Select all
Sub PasteToCellsEnd()
Dim TargetRange As Range
Dim oTargCell As Cell
Dim PasteRange As Range
If Selection.Cells.Count = 0 Then
'Quit if no cells in selection
MsgBox "No cells selected", vbCritical
Exit Sub
End If
On Error Resume Next
Set TargetRange = Selection.Range
For Each oTargCell In Selection.Cells
Set PasteRange = oTargCell.Range.Characters.Last
PasteRange.Collapse wdCollapseStart
PasteRange.Paste
Next oTargCell
TargetRange.Select
End Sub
1. At first run macro, i want to show message "select your table/cells........."
2. typing/input your text that you want to fill it into table/cell. --ok. (done)
anybody would help me out, thanks in advance
susant