Artik,thank you so much for this. It did what i needed it to do, now i just have to study it so i can learn from it!
Rick,I am intrigued if you think you can simplify the code. Basically, my intent is to replace the selected values with the new filtered values, so something like this to the end of Artik's code:
selection.ClearContents
selection.Resize(UBound(varrOutput, 1), UBound(varrOutput, 2)).Value = varrOutput
also, now i am seeing that the user may likely include the header in their selection which would end up getting filtered out. Is there a way to check if the header is selected when the header values are not predictable (other than a msgbox)? i guess i could modify my code that populates the sheet to begin with so that it is formatted in such a way that currentregion would work to get the range, instead of selection, and then the first row could always be assumed to be part of the range. unless you know of a way to check for it? your thoughts?
One other thing that i have never attempted, or even looked into, is building in the use of undo after initial run. is that even possible? would be nice to get the original values back with one undo click.
[EDITED]
JEC, Just saw your post after i posted this. i will give your code a try now.
[EDITED2]
JEC, the first bit of code didnt work for me because it uses currentregion, which my data is not currently set up for. i tried to change to selection, but then it didnt write out properly.
the second bit of code worked great when i changed the "With" to be selection, however this just satisfies the filter portion of my request. Now it would need to do the replacement of values in the first column. BETTER YET...leave those values alone and add an entire new column next to the selection and add the new values there, making the new array 4 columns wide.
Bookmarks