

Set rng = Sheets(sht).Range("A1:F" & last) Last = Sheets(sht).Cells(Rows.Count, "F").End(xlUp).Row
#Excel for mac vba to copy a sheet without command button code
'change filter column in the following code 'specify sheet name in which the data is stored

In this case, it creates four worksheets - 1, 2, 3, 4 as these are unique values in column Rank (column F). This macro would filter a column and paste distinct values to the sheets with their respective names. In the following excel macro, it is assumed a filter is applied on column F (Rank) and data starts from cell A1.Įxcel Macro : Filter and Paste Unique Values to New Sheets

Suppose you are asked to apply filter on a column and paste result of a filter into a new worksheet or workbook and same process goes until all the unique values of the column are covered.
