'VBA Advanced filter copy repeating top line
I'm stuck trying to figure out how to use the AdvancedFilter Action:=xlFilterCopy
My data sits on L27:N2584 and it repeats (multiple cost codes per item). Using advanced filter (through tabs in excel and through VBA Code) I'm getting a space row and then a repeat of the information in L27:N27 at the bottom of my filtered data.
Through reading here on stack overflow, it seems the issues is as follows: advanced filter is using my first line as a header and not taking it into account for the filtering process.
The suggestion was to go up one row and run the advanced filter there (L26). Unfortunately, nothing gets copied over and I do not get an error message. My guess is because the "filter header" rows are blank. I cannot have header data show up in the paste location. Any suggestions for a work around?
For Reference:
intCE_Max = 2384
intSOV_Max = 171
Code:
Sheet3.Range("L27:N" & intCE_Max + 200).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet2.Range("C" & intSOV_Max + 1), Unique:=True
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
