• July 17, 2017
    Announcement: New site design for Microsoft Community

    In July, Microsoft will roll out the first of ongoing site improvements aimed to modernize Microsoft Community and help customers get the most out of their community experience.

    • During the roll out period, you may see the old or new site design depending on your location

    • We expect the roll out to finish by 31 July

    Note: Past private message conversations will not move to the new site design. Please save any private messages you would like to keep.

     Learn more about the upcoming site improvements in this thread.

    Thank you for being part of Microsoft Community!

 
Question
432 views

Copy only rows based on unique value in one column and paste them to another worksheet where the worksheet name equals column value

vcs0382 asked on

I have multiple worksheets in one shared folder.  There is one master worksheet but I need to break that out into separate worksheets based on each unique value in a column named ModCategory (column V).  So if I were to determine the unique values in this column by using this piece of code:

 

Columns("A:BO").Select
    Columns("A:BO").EntireColumn.AutoFit
    Range("V2").Select
'extract a list of unique ModCategory in this column
ws1.Columns("V:V").Copy _
  Destination:=Range("BQ1")
ws1.Columns("BQ:BQ").AdvancedFilter _
  Action:=xlFilterCopy, _
  CopyToRange:=Range("BP1"), Unique:=True
r = Cells(Rows.Count, "BP").End(xlUp).Row

'set up Criteria Area
Range("BQ1").Value = Range("V2").Value

 

In the end what I would like to do is extract only the rows for each unique value found, copy those rows and columns (A:BO) to another worksheet within that same shared folder where first two characters of that worksheet equal the unique values found in the master worksheet.  This would loop through until all the worksheets in that folder have been found and rows have been copied into each one. 

 

1 person had this question

Abuse history


progress