PDA

View Full Version : [SOLVED] Create a new workbooks for each Unique value



JOEYSCLEE
02-03-2017, 07:09 AM
Hi, there
I posted the related thread before and it was solved as per below link.


http://www.vbaexpress.com/forum/showthread.php?58398-Create-a-new-sheet-workbook-for-all-Unique-values-(Including-Pictures-Images)

Nevertheless, the Headers are moved to fourth rows and the first, second & third rows need to be kept in the new worksheets & workbooks. Also, there are 2 more columns in the worksheet and the Header names are changed as well. Enclosed the Example 2 for your reference.

Hence, would you please help to write the code for copying all rows (including pictures / images) with the same value in the column H (the Header - Mill and Vdr) of the range to a new workbooks? Hope that the macro can do for every unique value in this column and it can populate the filename as the Mill and Vdr name as worksheet name.:help

mana
02-03-2017, 05:03 PM
you need to correct 4 lines



>With ws.Cells(1).CurrentRegion


With ws.Cells(4, 1).CurrentRegion




>Vdr = .Cells(i, 6).Value


Vdr = .Cells(i, 8).Value




>With .Cells(1).CurrentRegion


With .Cells(4, 1).CurrentRegion




>.AutoFilter 6, "<>" & Vdr


.AutoFilter 8, "<>" & Vdr

JOEYSCLEE
02-05-2017, 06:42 PM
Hello, Mana:hi:
It's Great!! Thanks again for your help!!. :bow:

Veugger
09-30-2021, 09:07 PM
Workbooks can be a great way to organize your data and keep everything in one place. If you have the same type of data but with different unique values, it may be time to break out each workbook into its own file. This will allow you to see all of the unique values easier and not get lost in all of the information.

Veugger
10-04-2021, 12:49 AM
Workbooks can be a great way to organize your data and keep everything in one place. If you have the same type of data but with different unique values, it may be time to break out each workbook into its own file. This will allow you to see all of the unique values easier and not get lost in all of the information.