"carlo" wrote in message
news:834afa11-a96b-4fa0-bd7d-
=LEFT(CELL("filename",A1),1)
That returns the drive letter of the workbook name, which is not necessarily
the drive of the current working directory. Moreover, it is possible, though
not at all likely, that the drive letter may have two characters (if you
have a LOT of partitions and/or mapped drives).
Instead, use code like the following:
Function CurrentDrive() As String
Application.Volatile True
CurrentDrive = Split(CurDir, ":")(0)
End Function
You can then call this from a worksheet cell with
=CurrentDrive()
--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
"carlo" wrote in message
...
Hi Thunderbolt
if you want to have the drive letter (only the letter) you could use
following:
=LEFT(CELL("filename",A1),1)
otherwise to get the whole path, just use the cell function i used.
hth
Carlo
On Jan 18, 10:10 am, Thunderbolt2000
wrote:
I need to retrieve the current drive letter to use in my Excel
spreadsheet,
how do I retrieve it?