+ Reply to Thread
Results 1 to 7 of 7

Macro to move lines between tabs

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Macro to move lines between tabs

    Hi all,

    I hope you are all well. If you can help with this question it would be appreciated. Is there a way of using macros that will swap a line from one tab on a spreadsheet to another tab on the same spreadsheet based upon if i set a cell to say either open or closed.

    I have two tabs (open / closed) in a sheet and am setting up an issue log. The issue is entered in the open tab but when i set the issue to closed i would like the whole line to transfer to the next abailable line in the closed tab.

    Many thanks,

    Chemist
    Last edited by Chemistification; 07-08-2010 at 06:22 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to move lines between tabs

    Wouldn't AutoFilter or a PivotTable be simpler & certainly more efficient?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Wink Re: Macro to move lines between tabs

    Quote Originally Posted by royUK View Post
    Wouldn't AutoFilter or a PivotTable be simpler & certainly more efficient?
    Yes it would. The problem is that I have to use standard documentation that has the two tabs. One to show open issues and one to show closed issues. I was hoping i could find a macro that would stop me having to cut and paste the info between tabs (lazy i know) and would do it automatically when i set the issue to closed? Any ideas if its possible?

    Like your avatar by the way
    Last edited by Chemistification; 06-29-2010 at 06:35 AM.

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Macro to move lines between tabs

    Hi Chemistification;

    I'm doing this on the fly without a workbook, so it may not be bug free, but it should give you the idea on how to do it.

    Assuming that "Open" and "Closed" are in Column A on Sheet1, and you want the entire row moved to Sheet2.
    If these are wrong, just change the column letter and sheet name in the section marked by '******

    In sheet1 module (right mouse click sheet1 tab and select "View Code")

    Please Login or Register  to view this content.
    This will cause the Entire Row to move to Sheet2 as soon as you change Column A to "Closed"
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  5. #5
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Macro to move lines between tabs

    Hey Fox Guy,

    Cheers for that. Sorry it took me so long to reply ive been away. Ill give it a test run and let you know what i think. Thanks again for sorting the code.

    Chemist

  6. #6
    Forum Contributor
    Join Date
    08-19-2009
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Macro to move lines between tabs

    Fox Guy - Thats 100% perfect. Thanks so much for this. Cheers Loads

  7. #7
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Macro to move lines between tabs

    You're welcome. How about rating the answer by clicking the blue scales next to the message # in the upper right corner of the answer you liked

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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