Hello,
I have a spreadsheet that is updated with a macro finding the latest download in an appropriate folder. It looks as follows:
MyPath = "C:\User1\Downloads"
MyFile = Dir(MyPath & "*.xls", vbNormal)
......
Everything is working fine. Unfortunately, recently all the users have been assigned separate profiles,
so now the path to the folder depends on who is signed in and the macro works only
in one profile.
"MyPath" would have to be chosen from several different possibilities like:
"C:\User1\Downloads"
"C:\User2\Downloads"
"C:\User3\Downloads" etc.
Only one of them can be found at any one time.
Is there a way for write a code which would find which folder is available at any one time in "MyPath" variable. With an IF statement perhaps?
Thanks in advance for help with this issue.
I have a spreadsheet that is updated with a macro finding the latest download in an appropriate folder. It looks as follows:
MyPath = "C:\User1\Downloads"
MyFile = Dir(MyPath & "*.xls", vbNormal)
......
Everything is working fine. Unfortunately, recently all the users have been assigned separate profiles,
so now the path to the folder depends on who is signed in and the macro works only
in one profile.
"MyPath" would have to be chosen from several different possibilities like:
"C:\User1\Downloads"
"C:\User2\Downloads"
"C:\User3\Downloads" etc.
Only one of them can be found at any one time.
Is there a way for write a code which would find which folder is available at any one time in "MyPath" variable. With an IF statement perhaps?
Thanks in advance for help with this issue.