maxblack
New Member
- Joined
- Nov 15, 2016
- Messages
- 36
Hello Guys,
I need your help with following problem. I build a macro, which will be importing two xls, one with data from the report, which I generate everyday (sheets REPORT) and second xls which contain only account numbers written one under the other in separe rows (sheet ACCOUNTS).
Then when I will start macro it should delete from the report (sheets REPORT) all account numbers, which are different then these, which I imported.
I was thinking to using AutoFilter but the problem is how to add all of these accounts as Array's to the Autofilter.
Normaly I use to add things, which I would like to delete or do something inside the code, but I would like to make a step forward and make it more practicial, thats why I need you help Excel Gods
For now I have only AutoFilter code - like below:
Thanks a lot!
I need your help with following problem. I build a macro, which will be importing two xls, one with data from the report, which I generate everyday (sheets REPORT) and second xls which contain only account numbers written one under the other in separe rows (sheet ACCOUNTS).
Then when I will start macro it should delete from the report (sheets REPORT) all account numbers, which are different then these, which I imported.
I was thinking to using AutoFilter but the problem is how to add all of these accounts as Array's to the Autofilter.
Normaly I use to add things, which I would like to delete or do something inside the code, but I would like to make a step forward and make it more practicial, thats why I need you help Excel Gods
For now I have only AutoFilter code - like below:
Code:
Dim wb As Workbook
Set wb = ThisWorkbook
With wb.Sheets("REPORT").Range("A1").CurrentRegion
.AutoFilter field:=1, Criteria1:=?????accounts <> then imported?????
.Offset(1, 0).Resize(wb.Sheets(1).Range("A1").CurrentRegion.rows.Count - 1).rows.Delete
End With
Thanks a lot!