Call an Excel macro from Word with data
Why ae yo having the user copy and select items in the word document. Isn't
there a better way to fully automate the macro?
Is the names in the wrod document in a table? Can another column be added
in the tabble where you can place a checkbox? Can you copy the entire list
and paste it into excel in a temporary worksheet and then do the selection in
excel? I like this method the best.
"JackGombola" wrote:
I'm using Excel 2003 and Word 2003.
The text at the end of this post was related to an earlier question I asked
of this group that you answered fully. Thanks.
Now, I need to call that Excel macro from Word.
I will receive Word documents that contain player stats including last name
and team name. I will select last name and copy it to the clipboard and then
copy the player's team name to the clipboard.
What I would like to do then is to create a Word macro to:
1. Retrieve the last two items placed in the clipboard and pass that data
to an Excel workbook containing sheet 1 as (Lastname,Tname) . These two
items will replace the InputBox statement in the Excel macro.
2. Return to Word so the user can select and copy the next player and run
the Word macro again.
The solution below used Fname and Lname separed by commas. I really only
need Lname.
Thanks,
Jack
__________________________________________________ __________________
Hello All: I have an Excel 2003 spreadsheet that looks like this:
A B C
1 Lastname Firstname Col1 Col2 Col3 €¦ Col111
2 Lname 1 Fname1 FZN
.
.
.
101 Lname100 Fname100 X
Column C2 is frozen (FZN text above) so that I can scroll the columns and
rows without loosing my lastnames or firstnames in each row, or the column
headings.
I respond to an InputBox with €œJack,Gombola,Col111€ and the macro correctly
finds the right target cell as Row 101, col 111 (X marks this cell). What I
would like the macro to do next is to scroll the sheet horizontally and
vertically so that the X cell becomes positioned to the first frozen
location: FZN shown above.
Any suggestions are appreciated.
Thanks,
Jack
|