vba to fill down to last row code example
Example 1: how to continue formula in below line in vba code
Sub CopyDown()
Dim Lastrow As String, FirstRow As String, strtCell As Range
Set strtCell = ActiveCell
FirstRow = strtCell.Address
Lastrow = Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Address
Range(Lastrow).Formula = strtCell.Formula
Range(Lastrow).End(xlDown).Select
End Sub
Example 2: how to continue formula in below line in vba code
Range("$M$3").Formula = Range("G3") & (",") & Range("L3")
Dim Lastrow As Long
Application.ScreenUpdating = False
Lastrow = Range("L" & Rows.Count).End(xlUp).Row
Range("M4").FormulaR1C1 = Range("G4") & (",") & Range("L4")
Range("M4").AutoFill Destination:=Range("M4:M" & Lastrow)
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
Example 3: how to continue formula in below line in vba code
Range("M3") = "=G3&"",""&L3": Range("M3:M" & LastRow).FillDown