![]() |
Moving records to a new sheet
I have a workbook with one worksheet in it. In this one (Master) worksheet there are a lot of records (rows). In each row there is either a 1, 2, 3, 4, etc... and I want to copy all the 1s to a new sheet, 2s to a new sheet, etc... This should be a simple task, but I'm confused by it. Some of the tabs will have multiple numbers in them. For example 4, 5, 9 are all in the same tab. I thought it would be best to use a Select Case statement for this, but I'm open to suggestions. Any and All help is much appreciated, DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=492025 |
Moving records to a new sheet
This should get you started (Ron de Bruin's site)
http://www.rondebruin.nl/copy5.htm -- Regards, Tom Ogilvy "DejaVu" wrote in message ... I have a workbook with one worksheet in it. In this one (Master) worksheet there are a lot of records (rows). In each row there is either a 1, 2, 3, 4, etc... and I want to copy all the 1s to a new sheet, 2s to a new sheet, etc... This should be a simple task, but I'm confused by it. Some of the tabs will have multiple numbers in them. For example 4, 5, 9 are all in the same tab. I thought it would be best to use a Select Case statement for this, but I'm open to suggestions. Any and All help is much appreciated, DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=492025 |
Moving records to a new sheet
Thanks for the reference Tom. I went to the website you suggested and tried some of his code. The Sub that was closest to what I was needing (or so I think) is Sub Copy_With_AdvancedFilter_To_Worksheets. The only problem is that I want to copy the entire row, not just one cell in a given range. Here is the snippet of code that I think needs to be changed to copy the entire row, but I'm not sure. ' rng.AdvancedFilter Action:=xlFilterCopy, _ ' CriteriaRange:=.Range("IU1:IU2"), _ ' CopyToRange:=WSNew.Range("A1"), _ ' Unique:=False TIA, DejaVu -- DejaVu ------------------------------------------------------------------------ DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629 View this thread: http://www.excelforum.com/showthread...hreadid=492025 |
All times are GMT +1. The time now is 10:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com