Copy first 10 Cells in a column of filtered and sorted data to another sheet.
Trying to write VBA to copy first 10 cells of a filtered and sorted data-set that will change each time query is run so using row numbers doesn't work. I have an example workbook attached that hopefully clarifies the request.
Martin, I get a runtime error saying the copy and paste areas aren't the same size.
Norie, This works but I can't tell how I might add another column. For example, how would I modify this to also bring the "Type" (column A) to the Results sheet in column D?
Thanks!
swjtx99
Martin Liss
You should use Norie's code. It seems to work perfectly.
Martin, I get a runtime error saying the copy and paste areas aren't the same size.
Norie, This works but I can't tell how I might add another column. For example, how would I modify this to also bring the "Type" (column A) to the Results sheet in column D?......Never mind, I figured it out!
Thanks!
swjtx99
swjtx99
ASKER
Hi Norie, Actually, I didn't figure it out. Can you tell me how to modify this to grab additional columns?
Thanks,
swjtx99
ASKER
Hi Norie, Actually, I did figure it out. I started getting weird results and after hours of troubleshooting, I figured out that I had to sort the data before filtering it. Not sure why that matters but it did for me!
Open in new window