Button Macro in Word to automate calculations

N

Ned23

I would like to know if anyone can point me to an example of a macro that you
would assign to a command button in Word 2007 that calculates a result based
on values from multiple cells in a table and put that result in another cell
in a table.

Any help would be appreciated,
Thanks.
 
C

Cindy M.

Hi Ned,
I would like to know if anyone can point me to an example of a macro that you
would assign to a command button in Word 2007 that calculates a result based
on values from multiple cells in a table and put that result in another cell
in a table.
And how do you expect to identify the cells with the values you want to
calculate, as well as the target cell?

What kind of "command button" is this?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
N

Ned23

Hi Cindy,
I do not know what the syntax is to identify the cells in the Macro.
That's why I asked to see an example of a macro that does this. I used to be
a programmer so I can usually pick up syntax pretty easily if I can see an
example.

The "Command Button" I am referring to is in the bottom half of the 'form
controls' box under the "Active-X Controls" heading. The form controls are
in the "Developer" tab.
 
C

Cindy M.

Hi Ned,
I do not know what the syntax is to identify the cells in the Macro.
That's why I asked to see an example of a macro that does this.
Mmm. Word doesn't really have a way to identify cells in the sense that
Excel has. You can count the rows and columns to identify a cell, but I
don't know if that is appropriate for your scenario.

The other possibility would be to place bookmarks on the cells (select
the cell, then Insert Bookmark), but then you have to know in advance
which cells this will be.

You don't really give us enough information to determine which approach
(if any) would work, so it's difficult to give you anything...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
N

Ned23

I asked if anyone had an example that I could see where they have done this.

That is: Does anyone have an actual word document with two or more tables in
it and where they are doing calculations that take values from cells in
different tables?

That is all I need to see. I can look at the tables in the document, then
look at the macro and I can see how it's done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top