On an Excel sheet, Col A has many thousands of rows that are sorted and formatted like this:
C:\\Folder1\Folder2\fileA
C:\\Folder1\Folder2\fileB
C:\\Folder1\Folder2\Folder3\fileC
C:\\Folder1\Folder2\Folder3\fileD
C:\\Folder1\Folder2\Folder3\fileE
C:\\Folder1\Folder2\Folder4\Folder5\fileF
C:\\Folder1\Folder2\Folder4\Folder5\fileG
and I’d like to convert to this:
C:\\Folder1\Folder2\
fileA
fileB
C:\\Folder1\Folder2\Folder3\
fileC
fileD
fileE
C:\\Folder1\Folder2\Folder4\Folder5\
fileF
fileG
etc.
I’d prefer to do it with VBA if possible.
Then, with that done, there will frequently be folders that have so many enclosed files that the list extends beyond one screen height, and so there’s no indication of which folder the visible files belong to. I’d like to extract the path of the last folder that scrolled off screen at the top, and maybe put it into a var that gets updated with the scroll, then I’ll put that on a TextBox and leave it out for reference.
Ok, that last part looks hard, but full marks if you can help me get the first part done.
- Thanks
This should work for you. Since there is no event to capture when the user scrolls, the folder “header row” is repeated every 20 rows if necessary.