Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Using Excel to generate Word macros

Please help me think this out -- maybe my plan is faulty.

WorksheetX is updated daily. From the values in WorksheetX, I want to
generate macros in Word (i.e., I want Word Macro cc7 to get data from row 7
of WorksheetX, cc8 to get data from row 8 of WorksheetX,etc.). Is this a
good way to accomplish what I want (or, would it be better to use Word
exclusively, and avoid using Excel? Personally, I find Excel easier to work
with...)

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Using Excel to generate Word macros

It sounds like you're trying to create a report using Word containing data
from your workbook. I've based my comments on that assumption. If I'm
incorrect, some of this might still apply.

From my view, your approach depends on: is your report a template, with only
certain, specific, unchanging data fields being updated? Or do which rows
of data are included change each time you generate a new report? If it's a
Word template, you can code in fields which draw data from your workbook,
esp. if you save the workbook with a convention such as "TodaysFile
mm-dd-yy" or create a copy of the update in a specific place with the same
name to replace the previous update.

But if your data locations change often, or you need to specify different
rows, then it might be better to work from the Excel side. Create a report
template in Word. In your Excel macro, call the Word doc and paste in your
data in the proper location, then SaveAs the Word doc.

HTH
Ed

"zSplash" <zNOSPAMSplash@ gci.net wrote in message
...
Please help me think this out -- maybe my plan is faulty.

WorksheetX is updated daily. From the values in WorksheetX, I want to
generate macros in Word (i.e., I want Word Macro cc7 to get data from row

7
of WorksheetX, cc8 to get data from row 8 of WorksheetX,etc.). Is this a
good way to accomplish what I want (or, would it be better to use Word
exclusively, and avoid using Excel? Personally, I find Excel easier to

work
with...)

TIA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Using Excel to generate Word macros

Hi, Ed. Thanks for the input.

Generally, what you assume is correct.

From my view, your approach depends on: is your report a template, with

only
certain, specific, unchanging data fields being updated? Or do which rows
of data are included change each time you generate a new report?

Each macro contains data from the spreadsheet uniquely formatted, the
spreadsheet's data changes daily.

If it's a
Word template, you can code in fields which draw data from your workbook,
esp. if you save the workbook with a convention such as "TodaysFile
mm-dd-yy" or create a copy of the update in a specific place with the same
name to replace the previous update.

Based on the updating of the spreadsheet, allows quick entry into the Word
document/template (of the data in the spreadsheet).

But if your data locations change often, or you need to specify different
rows, then it might be better to work from the Excel side.

I have it set up so that the Spreadsheet is updated daily. The plan is to
take that updated data and make it "be" in (or, accessed by) the various
macros, which are named based on the row of the spreadsheet (cc7=row7,
cc88=row88 of spreadsheet).

Create a report
template in Word. In your Excel macro, call the Word doc and paste in

your
data in the proper location, then SaveAs the Word doc.

What I was hoping to do is, in the Word document/template, call the various
macros, which "pull" from the Excel spreadsheet. I guess I have to have 300
unchanging separate macros (for 300 rows of the spreadsheet), which always
call the data from the changing spreadsheet.

Thanks again, for your input, Ed.

st.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Using Excel to generate Word macros

Have you looked at Word's Mail Merge capability? It lets you create a
template in Word, specify an XL data source, and indicate what tokens
in the Word document are replaced by the actual values from the XL
document.

If each of your rows of XL data correspond to a new Word document, all
the better. That is exactly what Mail Merge was designed to handle.

If for some reason you stick with your macro approach... it is hard to
imagine why you need a separate macro to access a different row of
data. Post a sample of these 300 macros and someone might be able to
suggest some streamlining.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , "zSplash"
<zNOSPAMSplash@ gci.net says...
Please help me think this out -- maybe my plan is faulty.

WorksheetX is updated daily. From the values in WorksheetX, I want to
generate macros in Word (i.e., I want Word Macro cc7 to get data from row 7
of WorksheetX, cc8 to get data from row 8 of WorksheetX,etc.). Is this a
good way to accomplish what I want (or, would it be better to use Word
exclusively, and avoid using Excel? Personally, I find Excel easier to work
with...)

TIA



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
Scripts / Macros in Word and Excel dleo Excel Discussion (Misc queries) 11 January 22nd 09 04:59 PM
Is there a way to generate a new Word doc everytime I enter data in an Excel row? Edward[_2_] New Users to Excel 2 April 7th 08 03:51 PM
Getting embeded Excel worksheets with macros in Word to work [email protected] Excel Discussion (Misc queries) 3 June 20th 06 01:56 PM
generate word file from excel memotronic Excel Worksheet Functions 3 December 23rd 05 06:19 PM
Excel won't allow macros but Word will. Chuck Thompson Setting up and Configuration of Excel 1 August 8th 05 03:17 AM


All times are GMT +1. The time now is 03:59 AM.

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"