If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|