Copy & Insert a Row using VBA

Anonymous
2025-04-01T16:01:40+00:00

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.

0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Anonymous
    2025-04-01T16:36:36+00:00

    Just change one line:

    '**Set Destination Row (below active cell)**

    DestinationRow = ActiveCell.Row + 1

    The activecell object does not use a sheet object...

    But when you say 'insert' - that has a specific meaning, and what your code does is copy the values over the existing row, rather than 'inserting' the row... probably what you actually want but I thought I should mention it.

    0 comments No comments
  2. Anonymous
    2025-04-01T16:54:03+00:00

    This worked almost perfectly. It is not inserting the row, it is pasting over anything that is in the row below the active cell. What do I need to change so that it inserts a row?

    0 comments No comments
  3. Anonymous
    2025-04-01T17:16:29+00:00

    '**Set Destination Row (below active cell)**

    DestinationRow = DestinationSheet.ActiveCell.Row + 1

    '**Insert a new row for the copied values**

    DestinationSheet.Rows(DestinationRow).Insert

    '**Copy the Row**

    SourceSheet.Rows(SourceRow).Copy Destination:=DestinationSheet.Rows(DestinationRow)

    0 comments No comments
  4. Anonymous
    2025-04-01T17:27:18+00:00

    Ugh, I'm now getting the original error message:

    0 comments No comments
  5. Anonymous
    2025-04-01T17:29:47+00:00

    Ooops! Sorry - I copied your original instead of the changed code:

    '**Set Destination Row (below active cell)**

    DestinationRow = ActiveCell.Row + 1

    '**Insert a new row for the copied values**

    DestinationSheet.Rows(DestinationRow).Insert

    '**Copy the Row**

    SourceSheet.Rows(SourceRow).Copy Destination:=DestinationSheet.Rows(DestinationRow)

    0 comments No comments