I would like to be able to
- take a sheet called "data" in a given workbook called "original_data.xlsm",
- copy it conditionally (using Autofilter or something else), say only those rows where column C was "dog"
- Create a new workbook, in the same folder as the original book, called dog.xlsm and save the copied stuff into a new sheet called "dog data".
- Then repeat with a different filter.So for example copy and autofilter if column C was "cat" and create a workbook "cat.xlsm", in the same folder as the original book, with a sheet called "cat_data" containing some filtered data.
I've been making incorrect attempts for three days now and would appreciate some help. Here is what I have done so far.
Workbooks.Add
Set wb = ActiveWorkbook
GetBook = ActiveWorkbook.Name
wb.Sheets("data").SaveAs Workbooks(GetBook).Path & "\dog"
Workbooks("dog.xlsx").Worksheets("Sheet1").UsedRange.AutoFilter Field:=3, Criteria1:="=dog"
But it's not working. :(