I am attempting to use a command button to copy rows to a different sheet in my excel workbook. I hope to type in the row number and have the VBA copy the row into a worksheet called "6.2022 Basis". My issue is "6.2022 Basis" has over 150 rows and my previous codes have overwritten some rows that I need. I am trying to use rngToCopy but I keep getting errors. Any ideas or advice would be greatly appreciated.
Private Sub CommandButton3_Click()
Dim rngToCopy As Range
Dim rngToPaste As Range
Set rngToCopy = Application.InputBox("Select range in Updates", Type:=64)
Windows("6.2022 Basis").Activate
Set rngToPaste = Application.InputBox("Select range to Paste in 6.2022 Basis", Type:=64)
rngToCopy.Copy
rngToPaste.Activate
ActiveSheet.Paste Link:=True
End Sub
Private Sub CommandButton3_Click()
Dim rngToCopy As Range
Dim rngToPaste As Range
Set rngToCopy = Application.InputBox("Select range in Updates", Type:=8)
ThisWorkbook.Worksheets("6.2022 Basis").Activate
Set rngToPaste = Application.InputBox("Select range to Paste in 6.2022 Basis", Type:=8)
rngToCopy.Copy
rngToPaste.Activate
ActiveSheet.Paste Link:=True
End Sub
I think the new issue is I need to paste the row in a table for my sort functions to work, and then it tries to overwrite the cell.