+ Reply to Thread
Results 1 to 14 of 14

Need help with Macro that moves row to another sheet

  1. #1
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Need help with Macro that moves row to another sheet

    Hello,

    Here is a macro that I've found that does almost what I need. I am hoping someone can help modify or maybe point me in the direction of where I can learn how. I am trying to move each group of duplicate row values from Column A to it's own sheet. The data in column A is never the same, it varies each time I produce the excel file. For example:

    example.GIF

    Here's the code I am using;

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    What this is doing is moving everything to one sheet called duplicates. Should I just scrap this macro and rewrite it?

  2. #2
    Registered User
    Join Date
    07-20-2012
    Location
    United States
    MS-Off Ver
    Mac 2011 and Windows Excel 2010
    Posts
    14

    Re: Need help with Macro that moves row to another sheet

    All is fine with your macro. The only additional thing is that you need is to add a new sheet and paste your "Redundant" Values every time you encounter one. So Add a new sheet and do the same process. I am not going to write the entire code.. But, this is what you need to do.. You can figure it out..


    Please Login or Register  to view this content.
    Last edited by stcharun; 01-17-2013 at 01:08 PM. Reason: Wrapping code

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    stcharun,
    Please wrap you code. How to Edit your code:

    Edit-highlight your code and click #

  4. #4
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Need help with Macro that moves row to another sheet

    I've been messing with this for almost a few hours and all it seems to be doing is adding a new sheet to the workbook.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Anyone have other suggestions? Anyone know of any good books I can get to help me figure this stuff out?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    Audio,
    What is the issue with your first code? What do you think is missing from your code, or what do you want add to your code?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    Try this code

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Need help with Macro that moves row to another sheet

    Thank you that did work however I dont believe I am explaining myself correctly. What I am trying to do is if you take a look at the attached workbook I am trying to move every group of different "code" from Row A and move each group to its own sheet. So for instance I want to move "001014" to a sheet, "BURFCI" to it's own sheet, and so on.TESTfile.xlsx.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    If you mean creating tabs for each code on column "A", try this one.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Need help with Macro that moves row to another sheet

    Quote Originally Posted by AB33 View Post
    If you mean creating tabs for each code on column "A", try this one.

    Please Login or Register  to view this content.
    Thank you, I tried this but all it did was delete all the data on the sheet.

  10. #10
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Need help with Macro that moves row to another sheet

    I don know if this is what you meant..
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    Audio,
    No, the code does not delete all the sheets.
    The code creates tabs for each code on column "A" from the page1 sheet. If the tab has already exists and you re-run the code, it clears the existing data on all the tabs except tab page1. The idea is that the code does not create duplication of names (Tabs) and data when you re-run it. When you run it for the first time, it will not delete any data as you have not created the tabs yet, but it creates tabs for each code. So, I do not know how when you run it for first time deletes all the sheets as there is not data or tab

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with Macro that moves row to another sheet

    I have tested renames' code and has the same result as mine, so my interpretation of your request was right.

  13. #13
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Need help with Macro that moves row to another sheet

    Quote Originally Posted by rename View Post
    I don know if this is what you meant..
    Thank you Rename, this worked perfectly.

  14. #14
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Need help with Macro that moves row to another sheet

    Quote Originally Posted by rename View Post
    I don know if this is what you meant..
    Is there anyway to do this without having to put it into a table?

    thanks again.

+ 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