(Msg. 1) Posted: Thu Nov 20, 2008 12:23 pm
Post subject: Button Macro for Caclulating in Word Tables Archived from groups: microsoft>public>word>tables (more info?)
Can 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 one table and puts that result in another cell in a
separate table?
I've been told that I cannot link Excel spreadsheets for this application;
it has to be stand-alone Word. So, I either have to do this in Word or not
do it.
(Msg. 2) Posted: Fri Nov 21, 2008 3:02 am
Post subject: Re: Button Macro for Caclulating in Word Tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
To force a re-calc in the linked table, simply select the cell(s) concerned and press F9. Alternatively, you could insert a
MACROBUTTON field onto the linked table, coded as {MACROBUTTON CalcTable Update} and use the following macro:
Sub CalcTable()
Dim oFld As Field
For Each oFld In Selection.Tables(1).Range.Fields
oFld.Update
Next
End Sub
Note: The field brace pairs (ie '{ }') for the MACROBUTTON field are created via Ctrl-F9 - you can't simply type them or copy &
paste them from this message.
Similar macro code could be used for a command button.
--
Cheers
macropod
[MVP - Microsoft Word]
"Ned23" <Ned23 RemoveThis @discussions.microsoft.com> wrote in message news:42BECD87-F42B-442C-A83A-BC4263FFF634@microsoft.com...
> Can 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 one table and puts that result in another cell in a
> separate table?
>
> I've been told that I cannot link Excel spreadsheets for this application;
> it has to be stand-alone Word. So, I either have to do this in Word or not
> do it.
>
> Any help would be appreciated,
> Thanks.
>
(Msg. 3) Posted: Thu Dec 11, 2008 7:01 am
Post subject: Re: Button Macro for Caclulating in Word Tables [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thanks macropod. I've downloaded your file and am studying it and have
built a file with some macros in it and am fiddling around with it.
To anyone else out there, I'd like to say that I'm more of a visual
learner, so if anyone has an example of the process in action, I'd appreciate
it. By that I mean an example where someone actually has a Word 2007 file
with a couple of tables in it and a macro to go with it that calcualtes some
results when you press a command button. I think I could look at that and
very quickly adapt it to my forms.
Thanks,
Ned.
"macropod" wrote:
> Hi Ned,
>
> To see how to reference cells in another table in Word, check out my Word Field Maths 'tutorial', at:
> http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442 > or
> http://www.gmayor.com/downloads.htm#Third_party > In particular, look at the item titled 'Reference Table Cells From Outside The Table'
>
> To force a re-calc in the linked table, simply select the cell(s) concerned and press F9. Alternatively, you could insert a
> MACROBUTTON field onto the linked table, coded as {MACROBUTTON CalcTable Update} and use the following macro:
>
> Sub CalcTable()
> Dim oFld As Field
> For Each oFld In Selection.Tables(1).Range.Fields
> oFld.Update
> Next
> End Sub
>
> Note: The field brace pairs (ie '{ }') for the MACROBUTTON field are created via Ctrl-F9 - you can't simply type them or copy &
> paste them from this message.
>
> Similar macro code could be used for a command button.
>
> --
> Cheers
> macropod
> [MVP - Microsoft Word]
>
>
> "Ned23" <Ned23.TakeThisOut@discussions.microsoft.com> wrote in message news:42BECD87-F42B-442C-A83A-BC4263FFF634@microsoft.com...
> > Can 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 one table and puts that result in another cell in a
> > separate table?
> >
> > I've been told that I cannot link Excel spreadsheets for this application;
> > it has to be stand-alone Word. So, I either have to do this in Word or not
> > do it.
> >
> > Any help would be appreciated,
> > Thanks.
> >
>
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum