That worked perfectly. Thank you so much for your help!
Copy & Insert a Row using VBA
I am very new to VBA and need some help. I want to copy Row 1 from Sheet3 of my workbook and insert it in the ReviewCoverSheet worksheet within the same workbook below the active cell (regardless of which column I am in on the active row) shifting all the other rows down. Below is the code I'm using, although I'm not too confident it will get me what I need. Whenever I run it, I get a Compile Error: Method or data member not found that highlights "ActiveCell" in the Set Destination Row (below active cell).
I also have Checkboxes in the line I am trying to copy over on Sheet3 that I would like to ensure come over when copied and inserted. Any help is greatly appreciated.
Sub CopyRowBelowActiveCell()
'\*\*Declare Variables\*\*
Dim SourceSheet As Worksheet
Dim DestinationSheet As Worksheet
Dim SourceRow As Integer
Dim DestinationRow As Integer
'\*\*Set Source and Destination Sheets\*\*
Set SourceSheet = ThisWorkbook.Sheets("Sheet3")
Set DestinationSheet = ThisWorkbook.Sheets("ReviewCoverSheet")
'\*\*Set Source Row\*\*
SourceRow = 1
'\*\*Set Destination Row (below active cell)\*\*
DestinationRow = DestinationSheet.ActiveCell.Row + 1
'\*\*Copy the Row\*\*
SourceSheet.Rows(SourceRow).Copy Destination:=DestinationSheet.Rows(DestinationRow)
End Sub
Microsoft 365 and Office | Excel | For business | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
7 answers
Sort by: Most helpful
-
Anonymous
2025-04-01T18:27:26+00:00 -
Anonymous
2025-04-01T18:48:36+00:00 You're quite welcome, and thanks for letting us know that my suggestion worked for you.