+ Reply to Thread
Results 1 to 11 of 11

moving rows to a sheet

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    moving rows to a sheet

    i have created a spreadsheet which has a main sheet, it then looks at column b and creates a sheet for each unique value in that column. i now want it to move each row so to the corrosponding sheet which has been created.

    ie for every row which has value "a" in column b i want it to goto the sheet "a" etc basically filtering to the different sheets

    Any Help apreciated

    Thanks

    Steve

  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: moving rows to a sheet

    Do you have a sample file that you can upload?
    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]

  3. #3
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: moving rows to a sheet

    Sample.xls
    i would like it so the rows move to the sheets named the same as column B

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

    Re: moving rows to a sheet

    Try this code
    Please Login or Register  to view this content.
    Put it in a standard module.

    This code will create sheets for you if they do not exist. So you do not need a separate code just to create the sheets.

  5. #5
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: moving rows to a sheet

    Is there a ways so i can create headers for each column? while creating the sheets
    ie A = Site B= name C=Start date etc etc

    then save each sheet as a seperate excell file?
    Last edited by steveallany2k6; 07-09-2012 at 09:03 AM.

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

    Re: moving rows to a sheet

    Are these headers in the main sheet? They can be copied over to the tabs from there.

  7. #7
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: moving rows to a sheet

    in the script thats runs before that it deletes the header but i can just ommit the deling of the header so that row 1 would be the header so what code would i use so it copies it to every sheet and then saves each sheet as a single file?

    thanks for all this i apreciate it

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

    Re: moving rows to a sheet

    Edited code here
    Please Login or Register  to view this content.
    Do you want code to be added to the above which saves each sheet as a single excel file?

  9. #9
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: moving rows to a sheet

    If you can just make it as a separate module and then i can just call the module if thats ok.

    Regards

    Steve

  10. #10
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: moving rows to a sheet

    also when the data is transfered to each sheet how do i get it so the format is copied also as at the minute it does it not ver good. ie column widths are not right

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

    Re: moving rows to a sheet

    This is the updated code which also saves the sheets in separate files. The columns widths have been taken care of too.
    Please Login or Register  to view this content.
    Do you need a code to clear / delete each sheet if you want to run the macro a 2nd time, after all the sheets have been saved as separate files?

+ 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