Hi,
Fairly new to VBA. Been teaching it to myself the last few days. I've learned a ton, but now I feel like I'm stuck and need some help getting past this point.
So basically I am given an excel file with "blocks" of similar data, that is stacked vertically. I would like to be able to autofilter the data by some terms to pull out specific "blocks" of data, and paste them into a new sheet, but stack the "blocks" horizontally instead of vertically.
The attachment has the two sheets I'm working with. Element Forces - Frames is the input sheet. And Output is the output sheet. The cell borders can be ignored. I put those in there to make the "blocks" more visible to understand.
Here is what I have written so far.
So I would like it to run the first time, create the sheet "Output" if not already created. Copy the autofilter results. Find the last column containing data in "Output" and go to the next column and paste the results. Then I can run the script again with new autofilter terms, and it will take those results and paste them next to the first block of results. I'm mainly having issues with finding the last column containing data in the "Output" sheet using the .End(xlToLeft).Column+1. It's not ending up where I expect it to.
And I'm sure there is a much simpler/elegant way to do this, but I am just learning (first taste of vba ever was 1 week ago) so this has been the best I've been able to some up with so far.
Any help is very much appreciated.
*Edit - One thing I forgot to mention, is that not all the "blocks" are the same size. Which is why I used the UsedRange and not just a range of cells.
Bookmarks