+ Reply to Thread
Results 1 to 2 of 2

Code Repair - Copy Column to New Worksheet and Delete

  1. #1
    Registered User
    Join Date
    08-09-2010
    Location
    Halifax Canada
    MS-Off Ver
    Excel 2003
    Posts
    6

    Code Repair - Copy Column to New Worksheet and Delete

    I am trying to use some code to copy a column range that is in WKSHT 1 to WKSHT 2, using the trigger of the last value input - then delete the data in WKSHT 1 so that the next set of values can be input.

    The values posted to WKSHT 2 will be in column 2, and then the next set of values in column 3, and then 4 and so on.

    Here is the code that I am trying to use:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Row = 31 And Target.Cells.Count = 2 Then
    Target.Range(b23, b31).Copy Destination:=Sheets(2).Cells(1, Column.Count).End(xlUp).Offset(0, 1)
    Target.Range(b23, b31).Delete shift:=xlUp
    End If
    End Sub

    I copied this from a similar program which did the same function for "rows", but copied the entire row instead of a range. When I run it I get an error '424' in the instruction starting with Target.R...... and ending ....Offset(0,1)

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Code Repair - Copy Column to New Worksheet and Delet

    Hi and welcome to the board

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1