Hi All,
I am trying to filldown a couple of formulas that I have in columns W and X based on the last row of data in column A of that worksheet. The code works if I have the relevant sheet activated at the time but not when I have another sheet active.
I am trying to filldown a couple of formulas that I have in columns W and X based on the last row of data in column A of that worksheet. The code works if I have the relevant sheet activated at the time but not when I have another sheet active.
VBA Code:
Sub FillFormulas()
Dim Last_row As Long
Dim sh4 As Worksheet
Set sh4 = workbooks("Test.xlsm").Worksheets("Test Data")
Last_row = sh4.Cells(Rows.Count, 1).End(xlUp).Row
Range("W2:X" & Last_row).Filldown
End Sub