+ Reply to Thread
Results 1 to 2 of 2

Copy row of data to new row on another worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    4

    Copy row of data to new row on another worksheet

    Hi,

    I have a workbook that lists children attending a nursery. There is a different sheet for each room in each of the nurseries. I'd like to be able to move an entry from one sheet to another - for when a child moves to a different room. I need a macro to do this, assigned to a button.

    Attached is an example file with two of the sheets i'll be working with. In the example i'll bee needing to move entries from the top table in sheet 'SR Babies' to a new row in the top table of 'SR Toddler'. So far I have been able to get the row copied and ready to paste into a new row, but it doesn't seem to want to paste the content. And there is still the problem of removing the row in the source sheet afterwards.

    Now I know very little about VBA but here is the code I'm working on at the moment:

    Sub MoveUpSRB()
    
    Sheets("SR Toddler").Select
    Range("SRTOCurrent").Select
    
        ActiveSheet.Unprotect
        ActiveCell.CurrentRegion.End(xlToLeft).Offset(1, 0).EntireRow.Select
        Selection.Copy
        Selection.Offset(1, 0).Insert Shift:=xlDown
            On Error Resume Next
        ActiveCell.EntireRow.SpecialCells(xlCellTypeConstants, 23).ClearContents
        ActiveCell.EntireRow.ClearComments
        ActiveSheet.Protect , AllowInsertingRows:=True, AllowDeletingRows:=True, AllowSorting:=True
    
    Sheets("SR Babies").Select
    ActiveCell.EntireRow.Select
    Selection.Cut
    
    Sheets("SR Toddler").Select
    Range("A2").Paste (xlPasteAll)
    
    End Sub
    Any help would really be appreciated!

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy row of data to new row on another worksheet

    Which rows need to be moved? Would there be an identifier to denote which rows need to be moved?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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