Question:
Need help in VBA (Word & Excel) urgently!?
Hope it helps
2018-03-26 12:21:13 UTC
For those that are familiar with VBA, I am looking to create a macro that transfers data from WORD to EXCEL.
However, can MACRO handle these tasks or is it just better to sieve these information personally (im looking at 200 over word pages)

MICROSOFT WORD MACRO:
(1) How do I find a string of word and return a value associated with a word?
E.g. Number of Chickens: 17
Number of Eggs: 13
Farm: Arizona
(I need 2 variables, CHICKEN & FARM)

(2) I need to fill up a tables with 2 variables, CHICKEN & FARM. However, the FARM(X) must correspond
to a correct value of CHICKEN(Y). Which MACRO function should I use and define?
E.g.
X1= Arizona, Y1= 17
X2= New York, Y2=15

EXCEL
(3) After porting those 2 variables into excel, I need to compare with another sheet with variables X and Y.
In this case, Sheet 2 is missing New york.
How do I ask excel to run a macro to loop every cell to check whether New York is in Sheet 2?

E.g.
Sheet 1 (data from WORD document)
Cell A1= Arizona, cell B1=17
Cell A2= New york, cell B2=15

Sheet 2 (my own reference sheet)
Cell A1= Arizona, cell B1=17
Cell A2= Texas, cell B1=34

(4) How do I run another macro to CHECK whether A1=Arizona AGREES with B1=17 VALUE in both
sheets?


Thanks in advance!!
Three answers:
?
2018-03-26 12:47:13 UTC
I would ask your question at this board:

http://forums.windowssecrets.com/forumdisplay.php/4-Office-Applications



This is a moderated board with experts in all areas of MS Office including VBA.
no1home2day
2018-03-26 12:33:21 UTC
To the best of my knowledge, a macro can only work within the page it is running. It cannot run between apps or programs.



You can, however, save the data in the Word document as comma-delimited Text (data with commas between the pieces of data), then within Excel, you can insert or load the data.
anonimitie
2018-03-26 12:30:59 UTC
Macros don't work well inter-application. Try Python.



No macro necessary for part 3. c:c = Sheet2!B:B =B:B. I assume you mean are the figures equal since, "Arizona," will never be equal to 17.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...