A resource for users and developers of Microsoft Excel |
|||||||||
| Email us your FAQ suggestion. |
|||||||||
Visit often ! Pages are updated daily. |
|||||||||
This is the Excel "How to" Frequently Asked Questions page |
|||||||||
Answers to Frequently Asked Questions about how to do common tasks in Microsoft Excel. |
|||||||||
Excel "How to" FAQs |
| How to display the workbook's path (example, "C:\Your\Folder\Path\") in a cell? |
| Formula | =LEFT(CELL("filename",A1),FIND("~",SUBSTITUTE(CELL("filename",A1), "\","~",LEN(CELL("filename",A1))-LEN(SUBSTITUTE(CELL("filename",A1),"\",""))))) |
Notes: Workbook must be named (saved at least once) beforehand. The formula can be entered into any cell, including cell A1. |
| UDF | Function PathActiveWB() As String UDF formula entry: |
Notes: Workbook does NOT need to be named or saved beforehand. The UDF formula can be entered into any cell. |
| Macro | Sub PathActiveWB() ActiveCell.Value = ActiveWorkbook.Path & "\" End Sub |
Note: Workbook does NOT need to be named or saved beforehand. |