Hello,
I have some RAW data in a file which I use through a macro to update another sheet and refresh pivots.
In one of the columns there is 4 different names and I want the macro to produce a report for 3 of these names and exclude any data from the reports which is based on the 4th name.
Lets say the 4 names are as follows
John
Bob
Rich
James
Windows("Named Macro.xlsm").Activate
Sheets("Macro").Select
ActiveCell.Offset(0, 0).Select
Name = ActiveCell.Offset(0, 0).Value
File_Name = ActiveCell.Offset(0, 0).Value
ActiveCell.Offset(1, 0).Select
' Format Copy
Windows("Named Data.xlsx").Activate
Sheets("Named data").Select
Selection.AutoFilter Field:=28, Criteria1:=Name, Operator:=xlAnd, Criteria1:="<> James"
Rows("2:100000").Copy
Windows("Named Report.xlsm").Activate
Worksheets("Named data").Activate
Range("A28").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Would the above work? I have tried all different combinations but although its spliting the report based on the other names its also including James's data in it which I dont want.
Thank you,
I have some RAW data in a file which I use through a macro to update another sheet and refresh pivots.
In one of the columns there is 4 different names and I want the macro to produce a report for 3 of these names and exclude any data from the reports which is based on the 4th name.
Lets say the 4 names are as follows
John
Bob
Rich
James
Windows("Named Macro.xlsm").Activate
Sheets("Macro").Select
ActiveCell.Offset(0, 0).Select
Name = ActiveCell.Offset(0, 0).Value
File_Name = ActiveCell.Offset(0, 0).Value
ActiveCell.Offset(1, 0).Select
' Format Copy
Windows("Named Data.xlsx").Activate
Sheets("Named data").Select
Selection.AutoFilter Field:=28, Criteria1:=Name, Operator:=xlAnd, Criteria1:="<> James"
Rows("2:100000").Copy
Windows("Named Report.xlsm").Activate
Worksheets("Named data").Activate
Range("A28").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Would the above work? I have tried all different combinations but although its spliting the report based on the other names its also including James's data in it which I dont want.
Thank you,