Copy data - Multiple Word Pages to Excel

December 30th, 2011 - 09:48 pm ET by Raghu | Report spam
I want copy data in word document (multiple pages copy like pages 3 to
10) and paste it to excel.
email Follow the discussionReplies 4 repliesReplies Make a reply

Similar topics

Replies

#1 Gord Dibben
December 31st, 2011 - 11:29 am ET | Report spam
What is preventing you from doing that?


Gord

On Fri, 30 Dec 2011 18:48:28 -0800 (PST), Raghu
wrote:

I want copy data in word document (multiple pages copy like pages 3 to
10) and paste it to excel.
Replies Reply to this message
#2 Auric__
December 31st, 2011 - 03:14 pm ET | Report spam
Gord Dibben wrote:

On Fri, 30 Dec 2011 18:48:28 -0800 (PST), Raghu
wrote:

I want copy data in word document (multiple pages copy like pages 3 to
10) and paste it to excel.



What is preventing you from doing that?



In other words, Raghu: can you be more specific with the description of your
problem?

You were never paranoid... until they started coming after you.
Replies Reply to this message
#3 Raghu
January 01st, 2012 - 05:42 pm ET | Report spam
Sorry for the confusion...

Here is the problem - I have word document which is having data for
more 200 pages. I need a macro in excel which should copy data from
pages 100 - 150 from word file and paste it in Excel (Sheet1).
Replies Reply to this message
#4 Raghu
January 02nd, 2012 - 06:22 am ET | Report spam
Hi all

I got the sollution :). Please let me know, if you have easy way.

Sub NewMacro()
Dim WdApp As Word.Application 'Word Application
Dim WdDoc As Word.Document 'Word Document
Dim rgePages As Word.Range
Dim StartPageNum As Double
Dim EndPageNum As Double

StartPageNum = 100
EndPageNum = 150

On Error Resume Next
Set WdApp = GetObject(, "Word.application")
If Err.Number <> 0 Then
Set WdApp = CreateObject("Word.application")
End If
On Error GoTo 0

On Error Resume Next
Set WdDoc = WdApp.Documents("File Name") 'Please change your file name
If Err.Number <> 0 Then
Set WdDoc = WdApp.Documents.Open("C:\File Name") 'Please change your
file name and path
End If

WdApp.Documents(WdDoc).Activate
WdApp.Visible = True

WdApp.Selection.Goto what:=wdGoToPage, which:=wdGoToAbsolute,
Count:
Set rgePages = WdApp.Selection.Range
WdApp.Selection.Goto what:=wdGoToPage, which:=wdGoToAbsolute,
Count:@
rgePages.End = WdApp.Selection.Bookmarks("\Page").Range.End
rgePages.Select
End Sub
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search