UPD:
Some information regarding my real case. Here's the UserForm I'm using:

In my Userforms, Duration/CED textboxes are named as Dur1-Dur6, and S/C Frequency textboxes are named as sc1-sc6.
The main purpose of the macro is to copy a table template and paste it alongside the main table with required formulas, based on S/C Frequency, like this.
The full code I have:
Private Sub OkButton_Click()
TheStart:
Dim FirstRow2 As Integer: FirstRow2 = 18 'set the number value of first row with formulas
Dim LastRow2 As Integer: LastRow2 = Range("L1000").End(xlUp).Row
Dim AQCol As Integer: AQCol = 11 'set the number value of AQ column in the Main Table (to calculate relative reference for formulas)
If Supplier_Data.SuppName = "" Then
MsgBox "Please enter supplier's name"
Exit Sub
End If
Dim LastCol1 As Integer: LastCol1 = Range("IV18").End(xlToLeft).Column
If Supplier_Data.Dur1 = "" Or Supplier_Data.sc1 = "" Then
MsgBox "Please enter at least one duration and s/c frequency"
Exit Sub
'copy TEST table
ElseIf Supplier_Data.Dur1 = "TEST" Then
Sheet5.Range("A7:C10").Copy
Sheet6.Cells(15, LastCol1 + 1).PasteSpecial (xlPasteAll)
Sheet6.Cells(15, LastCol1 + 1).Value = Supplier_Data.SuppName.Value & " " & Supplier_Data.Dur1.Value & " " & "offer"
Sheet6.Cells(17, LastCol1 + 1).Value = Supplier_Data.sc1.Value
Else
Sheet5.Range("A2:C5").Copy
Sheet6.Cells(15, LastCol1 + 1).PasteSpecial (xlPasteAll)
Sheet6.Cells(15, LastCol1 + 1).Value = Supplier_Data.SuppName.Value & " " & Supplier_Data.Dur1.Value & " " & "offer"
Sheet6.Cells(17, LastCol1 + 1).Value = Supplier_Data.sc1.Value
End If
'Calculate AS for each line
For i = FirstRow2 To LastRow2 - 1
If Supplier_Data.sc1.Value = "ppd" Then
ASFormula = "= (r[0]c[-2] * 365/100) + (r[0]c[" & AQCol - (LastCol1 + 3) & "] * r[0]c[-1])/100"
ElseIf Supplier_Data.sc1.Value = "PD" Then
ASFormula = "= (r[0]c[-2] * 365) + (r[0]c[" & AQCol - (LastCol1 + 3) & "] * r[0]c[-1])/100"
ElseIf Supplier_Data.sc1.Value = "PM" Then
ASFormula = "= (r[0]c[-2] * 12) + (r[0]c[" & AQCol - (LastCol1 + 3) & "] * r[0]c[-1])/100"
ElseIf Supplier_Data.sc1.Value = "PQ" Then
ASFormula = "= (r[0]c[-2] * 4) + (r[0]c[" & AQCol - (LastCol1 + 3) & "] * r[0]c[-1])/100"
End If
Sheet6.Cells(i, LastCol1 + 3).FormulaR1C1 = ASFormula
Sheet6.Range(Cells(FirstRow2, LastCol1 + 1), Cells(FirstRow2, LastCol1 + 3)).Copy
Sheet6.Range(Cells(i, LastCol1 + 1), Cells(i, LastCol1 + 3)).PasteSpecial (xlPasteFormats)
Next i
'Total Estimated AS
Sheet6.Cells(LastRow2, LastCol1 + 3).FormulaR1C1 = "=SUM(r" & FirstRow2 & "c" & LastCol1 + 3 & ":r" & LastRow2 - 1 & "c" & LastCol1 + 3 & " )"
Sheet6.Range(Cells(LastRow2, LastCol1 + 1), Cells(LastRow2, LastCol1 + 3)).Borders.LineStyle = xlContinuous
Sheet6.Range(Cells(LastRow2, LastCol1 + 1), Cells(LastRow2, LastCol1 + 3)).Font.Bold = True
Supplier_Data.Hide
End Sub
So, in order not to have the same piece of code for all Durations, I am looking for a way to run code, starting from Dim LastCol1 As Integer: LastCol1 = Range("IV18").End(xlToLeft).Column (so that Macro Generated Table 2 will be near Macro Generated Table 1, not overwriting it), for each Duration/CED textbox filled.
If anyone could suggest the solution, I'd really appreciate it!