Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:39:42+00:00 2026-06-07T10:39:42+00:00

First off, I have never used VBA (or VB for that matter), so keep

  • 0

First off, I have never used VBA (or VB for that matter), so keep that in mind. I am trying to copy a row to another sheet in my workbook. So whenever any change in row 2 will happen in sheet1, that row should be copied in row 2 on sheet2. If row 3 is modified in sheet1, row 5 should be modified on sheet2. I want there to be an empty row between each row on sheet2. I am going to try and create a new table with VBA to place inside this empty row. Anyways, I am getting an error on my Selection.Paste line. I have very limited knowledge (an hours worth) on VBA, so I could be completely off on what I am trying to do.

Private Sub Worksheet_Change(ByVal Target As Range)
 'Do not worry about column headers
  If Target.Row = 1 Then Exit Sub

  'On Error GoTo ErrHandler
  Application.EnableEvents = False 'This might be necessary?

  Sheet1.Rows(Target.Row).Select
  Selection.Copy
  Sheet1.Rows(Target.Row).Copy

  If Target.Row = 2 Then
    Sheet2.Rows(Target.Row).Select
    Selection.Paste
  Else
    Sheet2.Select
    Sheet2.Rows(Target.Row + Target.Row - 1).Select
    Selection.Paste
  End If

ErrHandler:
  Application.EnableEvents = True 'This might be necessary?
End Sub

Edit: After changing Selection.Paste to ActiveSheet.Paste, it is now working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:39:43+00:00Added an answer on June 7, 2026 at 10:39 am

    EDIT: added dealing with multi-area selections

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim a As Range, rw As Range
        For Each a In Selection.Areas
            For Each rw In a.Rows
                If rw.Row >= 2 Then
                    rw.EntireRow.Copy Sheet2.Cells(2 + (rw.Row - 2) * 3, 1)
                End If
            Next rw
        Next a
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
I am trying to create a very basic sprite image. First off i have
First off I should say that I don't have any experience in working with
First, I'll start off by saying that I do not have control over the
First off, I know I can copy "this" on instantiation, but that doesn't work
I have some divs that I'm trying to toggle on and off. I'm running
I have never used virtualization, and am trying to get up to speed. My
First, yes, I know that regex should never be used to parse HTML, however,
First off thanks to all the users who have made my android developing adventure
First off - apologies for the poor title, I have no idea how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.