View Single Post
 
Old 03-09-2014, 06:28 PM
VBLearner VBLearner is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Mar 2014
Posts: 1
VBLearner is on a distinguished road
Default VBA Code to take data from a table in word document and place it in a summary table

This is in the same document. I tried to record the code, but I keep getting an error saying "value out of range". I essentially want to take a revision date from a certain part of a table and copy and paste it to a summary table in the same document.

This is what I tried:

Code:
Sub Copy_To_Index()
'
' Copy_To_Index Macro
'
'
    Selection.MoveLeft Unit:=wdCharacter, Count:=16, Extend:=wdExtend
    Selection.Copy
    ActiveWindow.ActivePane.VerticalPercentScrolled = -40
    Selection.MoveUp Unit:=wdLine, Count:=165
    Selection.MoveDown Unit:=wdLine, Count:=4
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.MoveRight Unit:=wdCharacter, Count:=3
    Selection.PasteAndFormat (wdFormatPlainText)
End Sub
Thanks for any help!
Reply With Quote