Consulting

Results 1 to 5 of 5

Thread: Create a new workbooks for each Unique value

  1. #1

    Create a new workbooks for each Unique value

    Hi, there
    I posted the related thread before and it was solved as per below link.

    HTML Code:
    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.
    Attached Files Attached Files
    Last edited by JOEYSCLEE; 02-03-2017 at 07:21 AM.

  2. #2
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    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

  3. #3
    Hello, Mana
    It's Great!! Thanks again for your help!!.

  4. #4
    Banned VBAX Newbie
    Joined
    Sep 2021
    Posts
    2
    Location
    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.

  5. #5
    Banned VBAX Newbie
    Joined
    Sep 2021
    Posts
    2
    Location
    Quote Originally Posted by Veugger View Post
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •