VBA Code/Formula to generate list of rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

I need to define a loan repayment schedule using PMT, IPMT and PPMT
functions which i fully understand. However, based on the number of
installments I need to define the corresponding number rows with the
sequential numbers.

Can anyone help me on his issue
 
I am not sure exactly what you are looking for, but you can modifiy this code
to enumerate the rows in Column A. This sample only fills 20 rows but if you
know how many lines you will need you simply change the cell A20 to a lesser
or greater number, of if you want to use a different column, change the A to
another letter.
You can also change the sheet name or index to suit.

Sub mbrfill()
Range("A1") = 1
Range("A2") = 2
Set SourceRange = Worksheets("Sheet1").Range("A1:A2")
Set fillRange = Worksheets("Sheet1").Range("A1:A20")
SourceRange.AutoFill Destination:=fillRange
End Sub
 
Back
Top