Re: Getting info from word using macros

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you've got many Word files and only one Excel file, you might be better
off recording macros in Word that reference the single Excel file, rather
than trying to create a program that references all the separate Word files.
Read all the below, think through it in your mind first, and maybe even try
it a few times without recording it.

In the Word VBE, you'd set a reference to the Excel library, then set
objects to your Excel application and Excel master file in your macro. Pull
up a Word doc. Highlight *Platform*: and copy, the CTRL+Home. Select
Record New Macro, CTRL+F, paste, Enter. This should take you to *Platform*:
.. Hit the Right Arrow.

Now is the tricky part. Is the portion you want for a data point always the
same length, or at least filling the same number of spaces? Or can you
CTRL+Shift+End to get to the end of the line with all of AND ONLY your data
point selected?

I'm suggesting this method because what I see in your response is a
text-based document, rather than a table-based doc. If you have Word docs
that are all formatted different from each other, writing one macro to fit
all of them is very difficult. If you have a few different formats, you can
get by with a few different macros.

Again, the key is consistency. You have to be able to go to the same point
in the document every time. A macro is not smart enough to recognize that
for this week or this doc, it must find two spaces instead of one because
someone stuttered on the space bar. If you can exercise any control over
the consistency, things will go much better.

If you do have tables, and these tables are in the same order every time,
with the same data points in the same cells of the same table every time,
it's much easier.

Ed

"joi2" <joi2.1w0z2m_1127837133.5156@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:joi2.1w0z2m_1127837133.5156@xxxxxxxxxxxxxxxxxxxxxxxx
>
> alright this is pretty much what I have to do I have a project due
> every week i need to sort out a bunch of tables that people send me.
> They pretty much have the same info in each table. but each table is
> broken apart and they are inconsistent. first I'm trying to find a
> macro to link the word file to excel. And second I want to find a way
> to copy the data from a cell in word and pasting it in a cell in excel.
> can someone send me a sample code or something to start off with here is
> what it looks like
> --------------------------------------------------------------------------
-------------------
> *Data Change Type/Application/Platform *
> --------------------------------------------------------------------------
-------------------
> *Type*: Power work, *Platform*: Power System (Data Center),
> *Application*:
> --------------------------------------------------------------------------
-------------------
> *Software/Hardware Status*:
> --------------------------------------------------------------------------
-------------------
> *Impacts IT*: No
> --------------------------------------------------------------------------
-------------------
> for example I want to copy the info after the : which is after
> platform. and paste it in a cell.
>
>
> --
> joi2
> ------------------------------------------------------------------------
> joi2's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=27554
> View this thread: http://www.excelforum.com/showthread.php?threadid=470764
>


.



Relevant Pages

  • RE: Structured References - Regression Analysis
    ... An Excel Application is not the same as an Access Application. ... Application to run an Access Macro. ... You may have to enble a reference library for it to work if you get an error. ... First turn on the Macro Recorder (tools Macro - start Recording). ...
    (microsoft.public.excel.misc)
  • Re: How do I delete a missing reference to a Macro
    ... You may clear the reference by deleting your Excelxx.xlb file and letting Excel ... Macro security is enabled. ... (where the other workbook is no longer available) ...
    (microsoft.public.excel.misc)
  • RE: Structured References - Regression Analysis
    ... I haven't used Excel 2007 so I don't know anything about advance features. ... I'm not sure what you think is the difference between a macro and VBA. ... You may have to enble a reference library for it to work if you get an error. ... on that table and not wanting to have to manually change the ranges each time ...
    (microsoft.public.excel.misc)
  • Re: Check to see if a Workbook has a Macro
    ... In Excel 2007 you can use the new ... 'set reference in Tools - Reference ... choose Macro Settings and check the Trust access ... LineCount = TotalCodeLinesInVBComponent ...
    (microsoft.public.excel.programming)
  • Re: Cant find project or library
    ... In the module, it appears I must reference the Solver.dll, ... I do need to reference the Addin Solver, ... Excel is not finding the Addins! ... When I try and run a macro off the Lexar, I get a message ""Compile Error: ...
    (microsoft.public.excel.programming)