Re: VBA, Advanced Filter
Quote from Batman;754573Display More
The macro isn't in the workbook you attached, but it refers to the ActiveWorkbook. Is the macro in a different workbook, but you then activate the workbook you want to work on, and manually run the macro?
I must admit to being a little lost as to what data you are trying to work on now. The first loop goes through each sheet, tests for the number of rows used in column C (where there is no data), then puts a formula in column F (where there is already data) that refers to column E (not C).
You then go through another loop of the worksheets in the same workbook. Why not add the new worksheet at the start of the macro and only have one loop?
As there is no data in column C, on which the size of 'myrg' is based, you only clear/overwrite 1 or 2 of the many currency cells populated in column F. I'm not sure whether you intend to clear these, or to write to and copy from a different column.
I thought that, in my last code, I had removed two duplicate statements that might be confusing the program:
If not, these should be removed, in particular the 'With wksSummary' as having that With inside the same With may well cause confusion.
I would need to understand a little more clearly what data you intend to work on in order to determine how best to change what you have.
1) Macro is in a different workbook, the start up workbooks pretty much . So I would open the sample file and then run it from those personal workbook files.
2) Yes it shouldnt be column C. It should be 'Scenario Name' column. That is completely wrong. Sometimes I've had to change this because the column I filter differs. I am working with a directory of files where this column I am filtering changes. "Scenario Name" is the header that should always be filtered. and be where the formula should be.
3) and Isnt what I posted the same code as what you had? I didnt know what part you meant to remove.