+ Reply to Thread
Results 1 to 13 of 13

Move ActiveCell.EntireRow to another sheet

  1. #1
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Question Move ActiveCell.EntireRow to another sheet

    Hi

    I need a simple macro that moves the entire row of a selected cell in a table on Sheet1 to the top of another table in Sheet2.

    Just to clarify the flow that I'm trying to achieve:

    1. Click any cell or row in the Table (A3 and onwards)
    2. Click the "Move to Sheet2" button
    3. A new row is added at the top op Sheet2
    4. The selected row / entire row of selected cell gets cut out of Sheet1 and move to the top of Sheet2

    EDIT: Attached example sheet
    Attached Files Attached Files
    Last edited by chriskay; 10-01-2019 at 03:31 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Move ActiveCell.EntireRow to another sheet

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Re: Move ActiveCell.EntireRow to another sheet

    My apologies, I intentionally didn't attach any worksheet because I thought it would be a simple 2-3 line code, and that the request was pretty straight forward :-D I attached a sheet to the main post

  4. #4
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Move ActiveCell.EntireRow to another sheet

    Hi
    Try
    Please Login or Register  to view this content.
    Last edited by mohadin; 10-01-2019 at 12:29 PM.

  5. #5
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Re: Move ActiveCell.EntireRow to another sheet

    Quote Originally Posted by mohadin View Post
    Hi
    Try
    Sub newrow()
    Application.ScreenUpdating = False
    Selection.EntireRow.Copy
    Sheets("Sheet2").Rows("3:3").Insert Shift:=xlDown
    Application.CutCopyMode = False
    Sheets("sheet2").Select
    Application.ScreenUpdating = True
    End Sub
    Thank you so much mohadin! I added a line at the end of the code to delete the selection in sheet1, and it works just the way I wanted it to :-)

  6. #6
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Move ActiveCell.EntireRow to another sheet

    you Are very well come
    Sorry forget about the cut issue
    Thank you for feedback
    Be happy

  7. #7
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Move ActiveCell.EntireRow to another sheet

    Just a different way of writing it

    Please Login or Register  to view this content.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  8. #8
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Re: Move ActiveCell.EntireRow to another sheet

    Quote Originally Posted by WasWodge View Post
    Just a different way of writing it

    Please Login or Register  to view this content.
    Kudos - I like it simple

  9. #9
    Registered User
    Join Date
    08-15-2014
    Location
    Denmark
    MS-Off Ver
    365 Pro
    Posts
    94

    Re: Move ActiveCell.EntireRow to another sheet

    Another question - how do I prevent the script from moving the first 2 rows of content? I don't want to accidentially move the line with buttons or the table header to Sheet2

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: Move ActiveCell.EntireRow to another sheet

    Quote Originally Posted by WasWodge View Post
    Just a different way of writing it

    Please Login or Register  to view this content.
    You can delete the part I highlighted in red above since Sheet1 must be the active sheet for the code to work (it is not possible to reference the ActiveCell on a non-active sheet).

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: Move ActiveCell.EntireRow to another sheet

    Quote Originally Posted by chriskay View Post
    Another question - how do I prevent the script from moving the first 2 rows of content?
    Put this line of code as the first line of code in the procedure...
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Move ActiveCell.EntireRow to another sheet

    Quote Originally Posted by Rick Rothstein View Post
    You can delete the part I highlighted in red above since Sheet1 must be the active sheet for the code to work (it is not possible to reference the ActiveCell on a non-active sheet).
    Habit I'm afraid, of course you are right there

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Move ActiveCell.EntireRow to another sheet

    @chriskay
    Administrative Note:

    Please don't quote entire posts unnecessarily. They are just clutter and make threads hard to read.
    Use the "Quick reply" instead
    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to move to the Cell below without ActiveCell?
    By antraxhol in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2018, 12:58 AM
  2. [SOLVED] activecell.entirerow.select end at column 14?
    By fight2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2015, 10:21 AM
  3. [SOLVED] Move Button To ActiveCell
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2014, 11:24 AM
  4. ActiveCell.EntireRow Problem
    By Slyone2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2010, 11:48 PM
  5. If ActiveCell.Font.Bold = True Then ... trying to specify a range, not 'entirerow'
    By Winawer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2006, 06:08 PM
  6. ActiveCell:move to another cell within a subtotal report within a macro
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 09:05 AM
  7. [SOLVED] VB TAB doesn't move activecell??
    By Ben W in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 12:06 PM

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