I need to duplicate a row that is full of formulas N times. N is defined by the number of rows on a different sheet. The formulas are unique per row, but I think autofill will handle that.
In "DestSheet": Row 1 is a header Row 2 has the line I want to replicate "Cnt" times, starting in Row 3. Row 2 has cells that are unique to the row - =Credentials!C2 I need Row 2 to be the same as row 2 but increment the row numbers So that I get =Credntials!C3 on row 3 and =Credentials!C4 on row 4 (other formulas are more complex - but follow the same model) When the function is done, "DestSheet" will have "Cnt" rows of what started on line 2
I am close from code I found on this site.....
Sub AddRows(Cnt As Integer, DestName As String)
Dim DestSheet As Worksheet
Dim i As Integer
Set DestSheet = Worksheets(DestName)
For i = 1 To Cnt
Sheets(DestName).cell(i + 2, 1).AutoFill _
Destination:=Range(LastRow)
Next i
End Sub ' AddRows
Range(LastRow)
– DavesexcelSub
? Do you know that in order to call it you need to create a separate sub? – ZygD