I want to select all the rows in “Data” worksheet except the first row and then copy and paste these selected rows into the next availbale row of my “Historical Data” sheet. I can copy and paste from data to historical data using code 1. And I can select all but row one in the active worksheet using code 2. But how can I combine them?
Code 1:
Copying and pasting
Sheets("Data").Range("A2:H2").Copy
With Sheets("Historical Data").Range("A" & Rows.Count).End(xlUp).Offset(1)
.PasteSpecial Paste:=xlPasteColumnWidths
.PasteSpecial Paste:=xlPasteValues
End With
Code 2:
Selecting all but first Row
Dim xColIndex As Integer
Dim xRowIndex As Integer
xIndex = Application.ActiveCell.Column
xRowIndex = Application.ActiveSheet.Cells(Rows.Count, xIndex).End(xlUp).Row
Range(Cells(2, xIndex), Cells(xRowIndex, xIndex)).Select