I am new to VBA. I am trying to copy cells J9:J22 and cell E7 from "final output sheet" to "saved results" sheet. Below is the macro I have written. It is not showing any error but on running it the single cell E7 is getting pasted, however J9:J22 are not and it is showing blank. Can you please help?
Private Sub CommandButton1_Click()
Dim noofboxes As Range, Depot As String
Worksheets("Final Output Sheet").Select
Set noofboxes = Worksheets("Final Output Sheet").Range("J9:J22")
Depot = Range("E7")
Worksheets("Saved Results").Select
Worksheets("Saved Results").Range("A1").Select
If Worksheets("Saved Results").Range("A1").Offset(1, 0) <> "" Then
Worksheets("Saved Results").Range("A1").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Depot
ActiveCell.Offset(0, 3).Activate
ActiveCell.Value = noofboxes
End Sub