I have Table1 which has 159 rows in column A. let's say the n = 159. I would like to use this number in another worksheet vba to determine the target range in Column G.Column G is not part of the table. I am used to coding in python and have a beginner's understanding of vba syntax. Would this be possible? Below is a sample of a code i researched in this site.
Sub FillDown()
Dim sh As Worksheet
Dim rn As Range
Dim strFormulas(1) As Variant
Set sh = ThisWorkbook.Sheets("Analysis")
Dim k As Long
Set rn = sh.UsedRange
k = rn.Rows.Count + rn.Row - 1
With ThisWorkbook.Sheets("Analysis")
strFormulas(1) = "=IFERROR(OR(Sheet1!A1:Z1), "")"
ActiveSheet.Range("F1").Formula = strFormulas
ActiveSheet.Range("F1:F").FillDown
End With
End Sub
In this line: ActiveSheet.Range("F1:F").FillDown
I would like to add the 'n':
ActiveSheet.Range("F1 + n").FillDown
But this one doesn't work. I am also open to any resources you can provide for vba syntax specially for complex formulas
Thanks!