Any efficient way?Looping thru folders to get the files

  • 0129_QMCS_Login_Rev7 -New format-copy-3.xlsm

    Hello all,

    this is my first post here and new to vba.

    I have been learning and trying out few things for making my own application.

    I have a set of folders and sub folders inside them and many files in it.

    Am trying to run a macro which will loop thru all the folders and sub folders and get the files which I need.

    But I also want them to be displayed in a certain range based of a certain value.

    I don’t know how to pass a range from one sub to another sub routine.

    Hope someone can help me.

    *****Please look into the Sub Reload()*****

  • Edited once, last by royUK: add code tags ().

  • Basic way of a recursive file loop is this:

  • Dear trunten,

    thank you for the reply.

    I understand the recursive file loop

    But the thing I wanted to is to get the range value “r” and value of variable “I” from the reloadlist sub.

    Am not able to transfer these variables to the recursive loop so that the data can be written to where I want them to be written.

    Am sorry for the lack of knowledge here and my explanation may not be as progressional because of that.

    Hope u understand?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!