Do loop for specified time to perform calculations

D

Doc60

I am writing a Word Macro that I want to have calculate the value a column of
cellsl only when the value in another cell is > 0. I already have the
calculation setup but need have the macro look at a specific cell to see if
the value in the cell is > 0 and if it is, it should do the calculation in
another in the column of cells. If it is not > 0 then the macro should stop.

Thanks in advance.
 
M

macropod

Hi Doc60,

If you use a formula field for the calculation, then something as simple as doing a print preview will be enough to get it to
recalculate. Alternatively you could use a macrobutton field to drive a simple macro, coded like:
Sub ReCalc()
On Error Resume Next
ActiveDocument.Tables(1).Range.Fields.Update
End Sub

For some pointers on the use of formula fields, 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


Cheers
 

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