Macro to check drive letter

  • Thread starter Thread starter LB79 - ExcelForums.com
  • Start date Start date
L

LB79 - ExcelForums.com

Because users of my workbook have different drive letters for the same
network drive i have the following macro that enables them to all use
the same workbook/macro:

If Dir("G:\Workbook.xls") <> "" Then
Workbooks.Open "G:\Workbook.xls"
Else
Workbooks.Open "T:\Workbook.xls"
End If

This works really well BUT i need to adapt this to look at a thrid
drive too - I tried to add a second ELSE but this threw up debug
issues. Does anyone know of a way to have more then 1 ELSE in an IF
statement?
EG:
If Dir("G:\Workbook.xls") <> "" Then
Workbooks.Open "G:\Workbook.xls"
Else
Workbooks.Open "T:\Workbook.xls"
Else
Workbooks.Open "H:\Workbook.xls"
End If
 
Ive just answered my own question - i used and ELSEIF statement.

Thanks anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top