Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50070

Copy formula and change row number in VBA

$
0
0
Hi

I want to copy the formula in column "C" to each row, and change the row number each time i add a new row with data. Anyone know how to do this?

I know this won't work, but this is so that you may better understand what I want.

Code:

With ws
  .Cells(lRow, 1).Value = Me.txtbxQty.value
  .Cells(lRow, 2).Value = Me.txtbxCur.value
'This is where I need help
  .Cells(lRow, 3).Value = "=a2*b2"
End With


Viewing all articles
Browse latest Browse all 50070

Trending Articles