this is a simple recursive processing at each subfolder, if the tree depth increases, the next column on the right will be selected.
I've made this hundreds of times. to query a directory content, the VBA DIR function can help, but is not recursivity-compatible, the regular FindNextFile from the windows API should be used with a DECLARE statement.