This code is meant to rearrange a set of data I have based off the values in column A. The data is currently arranged in blocks of 5-8 rows that only have unique data in column B. I am trying to read through column A and move the data to a new sheet. Depending on the value in column A, the data from column B is placed under that header in the new sheet. All the data from one block is placed in the same row. I have attached the dummy data excel sheet that contains a similar data set. The first sheet shows how the data currently is formatted. The second sheet shows how I want the data to look.
At the bottom is the code I have so far. I am new to VBA so from what I understand this code could me much shorter and it would run faster. I am not really worried about how fast it runs just so long as it will do what I want. I was finally able to get the debugger to show and highlight the line with the error, unfortunately it didn't help me.
This is the line that is highlighted
I have tried multiple lines. Originally the code looked more like this:
But I received the same error. I have tried to SET the activeworkbook.worksheets("Sheet1") to be wCurrent and the other to be wNew but I was still getting the same errors. I posted another thread here. It started out really disorganized and I think it may be throwing people off. Only one person has tried to help but they really haven't said anything but that they will help me eventually and I think they have already forgot. I don't want to keep bumping old outdated threads.
Thanks,
Troll
NOTE: the special case is set up so that on certain data blocks one column A value may be adjacent to multiple column B values, it takes all of those cells and puts them in multiple rows under the right header. Then it adds rows to my data block counter so that the next row doesn't overwrite that data.
Bookmarks