I have included two parts of my code. The first lets the user select a folder to cycle through all excel documents and run more code against them. Then the second piece of code shows how I currently have created the savefilename (by using the doc count to name the file). This was primarily for testinf but I want to be able to use the name of the document instead of a number.
I would like to be able to set the current document name (highlighted in red in code section one) and declare it as a variable/string so I can use it in code section 2 instead of the "J" (also highlighted in Red) but I am struggling hard to work out how to do this.
This is a loop so doc name will change each loop. Is it just a matter of declaring inside the loop (something like set docname = *.xl?? and then use docname in the filename section because I have tried and I cannot get to work correctly)
Does anyone have any suggestions or solutions for this problem please?
Bookmarks