Amend existing macro to select a different address string if first string could not be found

Swaroon

Active Member
Joined
Nov 18, 2005
Messages
278
Hi,
I have a macro which is used by different users, has been working for years with no issues but now, due to an IT change, different users have been given different network addresses which I can't get to be changed so all have the same path.

In order for the code to run for all users,

One user will need the code written as N:\Capital Leasing\Operations\etc
Another user will need the code as N:\Operations\etc

Is there any code that I can insert that would say if
N:\Capital Leasing\Operations\etc
could not be found, then use
N:\Operations\etc ?

Thanks
Steve
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,793
Office Version
365
Platform
Windows
So you are just saying the mapping of 'N' is different for different users? Maybe this:

Code:
pth = "N:\Capital Leasing\Operations"
fld = Dir(pth, vbDirectory)
If Len(fld) = 0 Then pth = "N:\Operations"
 

Swaroon

Active Member
Joined
Nov 18, 2005
Messages
278
So you are just saying the mapping of 'N' is different for different users? Maybe this:

Code:
pth = "N:\Capital Leasing\Operations"
fld = Dir(pth, vbDirectory)
If Len(fld) = 0 Then pth = "N:\Operations"


Thanks for your help, worked great
 

Forum statistics

Threads
1,082,510
Messages
5,365,993
Members
400,865
Latest member
LuciaRomo

Some videos you may like

This Week's Hot Topics

Top