-1

Currently working on a spreadsheet which contain dynamic rows (ranges from 1500 to 3000). I need a formula in Column AA4 till the last row which contains the data. I have to use the right formula in AA column which get the data from the Q column.

First row of data is from the 4th row

Currently I am using

=Right(Q4,3)

Suppose the last row is 1632, the formula becomes =Right(Q1632,3).

Can anyone help me with the VBA for RIGHT formula for the above scenario?

Thanks

braX
  • 11,506
  • 5
  • 20
  • 33
  • 1
    [Find the last row](https://stackoverflow.com/questions/11169445/error-in-finding-last-used-cell-in-excel-with-vba), and then `Range("AA4:AA" & lastRow).Formula = "=RIGHT(Q4,3)"`. – BigBen Mar 12 '20 at 13:19

1 Answers1

0

You can do like that :

nb = Range("Q" & Rows.Count).End(xlUp).Row
Range("AA4:AA" & nb).Formula = "=Right(Q4,3)"
BigBen
  • 46,229
  • 7
  • 24
  • 40
TourEiffel
  • 4,034
  • 2
  • 16
  • 45