Link to home
Start Free TrialLog in
Avatar of karimjohnson
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(row)
    .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
Avatar of MeLindaJohnson
MeLindaJohnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of karimjohnson
karimjohnson

ASKER

Brilliant!