Hi all,
I have some troubles with macro. I need to drag down formulas and fixed values from range O3:BB8 to the end of data in column N.
I tried to do it this way, but it's not working:
Any ideas how to achieve it?
I have some troubles with macro. I need to drag down formulas and fixed values from range O3:BB8 to the end of data in column N.
I tried to do it this way, but it's not working:
VBA Code:
Public Function GetLastRow(Optional Col As Integer = 1, Optional Sheet As Excel.Worksheet)
If Sheet Is Nothing Then
Set Sheet = Application.ActiveSheet
GetLastRow -Sheet.Cells(Sheet.Rows.Count, Col).End(xlUp).Row
End If
End Function
Sub DragFormulas()
Dim LastRow As Long
LastRow = GetLastRow(1, Worksheets("SUM"))
Worksheets("SUM").Range("O3:BB8").AutoFill
Destination:=Worksheets("SUM").Range("O3:BB" & LastRow), _
Type:=xlFillDefault
End Sub
Any ideas how to achieve it?