Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Import filtered data into a word document

Is it possible to make a word-report from excel, where the data is divided
in groups based on different criterias?

An example, where towns starting on S i chosen first, then towns on O next:

Wordtext text text ....

Stockholm, Sweden
Sevilla, Spain
Sandefjord, Norway

More text, more text, more text ....

Oslo, Norway
Ohio, USA

And so on... - or are there any other solution on presenting multiple-sorted
data?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 206
Default Import filtered data into a word document

This code when run from Excel will copy your filtered data from Excel
and paste it into a specific Word Doc. Be careful where your cursor is
in the doc as it will paste where the cursor is.

Sub CopyFilteredDataToWord()

Dim wdApp As Word.Application, wdDoc As Word.Document

On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number < 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open("C:\Excel Forums
\LinkedToWord.doc") 'change the location and Doc Name
wdApp.Visible = True
Sheet2.AutoFilter.Range.Copy 'change sheet name of filtered data
wdApp.Selection.Paste
Application.CutCopyMode = False
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import data from Excel into Word document fomat Angela Excel Discussion (Misc queries) 3 September 14th 07 03:35 PM
import long Word document philr Excel Discussion (Misc queries) 9 May 11th 07 08:41 PM
how do I import variable data into a word document GaryPick Excel Discussion (Misc queries) 1 March 30th 06 03:49 PM
Import a word document JR Excel Worksheet Functions 1 March 30th 06 03:28 PM
how can I import excel data to word document powersree Excel Discussion (Misc queries) 1 October 10th 05 12:10 AM


All times are GMT +1. The time now is 09:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"