Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Doc60 Doc60 is offline
external usenet poster
 
Posts: 1
Default Do Loop in table to calculate only when specified

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.
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Do Loop in table to calculate only when specified

Dim check as Range
Set check = ActiveDocument.Tables(Index).Cell(rownum, colnum).Range 'Set
the range to the cell that may contain 0
check.End = check.End - 1 'strip the end of cell marker from the range
If Val(check.Text) = 0 then
'put you calculation code here
End if
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Doc60" wrote in message
...
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.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the formula to calculate a percentage in a Word table? J Kimble Tables 3 July 4th 23 12:37 PM
In word, how do I calculate cells in a table? Bettina Microsoft Word Help 1 July 3rd 07 06:03 AM
Auto calculate in a word table Signature Tool Tables 1 March 14th 06 06:17 PM
How do I set up formula in a table to calculate a percentage Jams Tables 1 August 15th 05 01:04 AM
in table in Word: calculate 3 things @ $20 = $60? Bergie Tables 3 November 4th 04 09:33 PM


All times are GMT +1. The time now is 01:52 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"