karimjohnson
asked on
using a variable in a word table formula
I want to write a subroutine that puts variables into cells in a table. The subroutine below works perfectly for the job except that I haven't found a way to have a variable in the formula:
With Selection.Tables(1).Rows(r ow)
.Cells(1).Range.Text = item
.Cells(2).Range.Text = desc
.Cells(3).Range.Text = qty
.Cells(4).Range.Text = price
.Cells(5).Formula "=c3*d3\#$,0"
End With
In this routine above the formula is hard coded to row 3. How can I modify that line to make it use the row variable used in the first line of the code snippet?
With Selection.Tables(1).Rows(r
.Cells(1).Range.Text = item
.Cells(2).Range.Text = desc
.Cells(3).Range.Text = qty
.Cells(4).Range.Text = price
.Cells(5).Formula "=c3*d3\#$,0"
End With
In this routine above the formula is hard coded to row 3. How can I modify that line to make it use the row variable used in the first line of the code snippet?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER