Hi
Within the same sub procedure I've gone through the steps below:
1 - I've started with two sheets, different data in each and the first step is to filter the first sheet for certain values, inserting a new worksheet and naming it and pasting the filtered values into the new sheet. Then deleting the first worksheet. (no probs, works great on its own)
2 - I have then gone through this process again with the second worksheet, buy filtering, inserting and renaming a new worksheet and pasting the filtered values into the new worksheet, then deleting the filtered worksheet (this is the second worksheet). (this also works fine on its own).
3 -I originally had two separate sub procedures to separate the two tasks above though when I joined them together and ran the macro the first part works fine ( Number 1 above ) though when it comes to filtering the second worksheet it goes back and filteres the worksheet I inserted the filtered values in from step 1 above.
I have calculation set to manual and think this might be it. Is this why the procedure goes back to the first worksheet used in 1 and filters values in that instead of the second sheet.
My other theory is that when I insert a new worksheet, it is identified as the second new worksheet I inserted (even though I have renamed them both before performing the actions above). Excel may not recognise them as different sheets?
Does anyone know what I may have done wrong there. The macro is too long ot paste in though I think this may be a conceptual issue involvind how vba identifies the sheets. If anyone could shead some light on this, it would be much apprecieated. Thanks.
Bookmarks