Common File Location

NewToVBA1

New Member
Joined
May 22, 2011
Messages
20
:confused:
Hi,
I have a master file that has macros. These macros opens and copies data from files located in the same folder as the master. So, all my macros in the master file has a file path declared as a string. If someone else uses my macros, they have to go to the individual macros to change the file path. I know there is a function that you can use to select the files using windows manually. But, I was wondering if there is a way to insert the path names in the macros so that if the user copies the other files in the same folder as the master file, he or she does not have to go to the individual macros in the master files and change the file name. No matter where the folder is, the user needs to place the files and the master file in the same folder and start running the macros.
Any help will be very much apprecaited.
Thanks
 
Great !! Its works...
Thanks a lot. I was thinking about the backslash but was not sure nor did I know how to add it at the end.
I appreciate your prompt replies.

I have another question:
As I have many files that are opened and closed, it takes time. I am worried the users will not know if the macros are running. Is there a way to pop up a message that says "Please wait, the macros are Running". It also looks neat.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I would recommend just having a simple Message Box just before those steps run that says something like:

Code:
MsgBox "The macros are about to start and could take a few minutes to run.  Please click OK and wait for completion message".

Then you could put another message box at the very end of your code indicating that the job is complete.
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top