![]() With just one click, you can get the result in your worksheet. You can get 3 different types of the path by the different formulas. This method will now change the current workbook. In this table below, we have input the result of the comparison of the three methods. Thus, the result will appear in the designated cell. When you need to get the path, you can run the macro by clicking the button “Run Sub” or press the button “F5” on the keyboard.You may also change the target cell in the codes according to your need. ![]() And the last one will also get the worksheet name. The second one will get the path with the file name. And for different purpose, the codes will be a little different. There are three different macros in the codes. Range("B3") = ActiveWorkbook.FullName & "," & ActiveSheet.Name 'get the path with the file name and the sheet name In this step, inputting the following codes into the new module:.After that, choose the option “Module” in the sub menu.And then click the tab “Insert” in the toolbar.Press the shortcut keys “Alt +F11” on the keyboard to open the Visual Basic editor.Method 3: Use VBA MacrosĮxcept for the above two methods, you can also use VBA macros to finish this task. Therefore, only the path will leave in the target cell. When you need to use the path, you can copy it and paste as values. You can choose one of the formulas according to your actual need. When you press “Enter” on the keyboard, you will see the result immediately. In addition, you can also get only the exact path without the name of the workbook. This formula will get the path to the name of the workbook. On the other hand, when you don’t need the sheet name, you can also change the formula. Except for the path and the name of the current file, you can also know the active sheet. And then press the button “Enter” on the keyboard.Īfter that, you will see the path in the cell.Now input the following formula into this cell”.Click the target cell in the worksheet.If you need to use the path in a worksheet, you can use Excel functions. You can only know the exact location of the path of current workbook. And then you can get access to the path easily. Here you will know the complete path of the current workbook. Just click the tab “File” in the ribbon and you can get the information. In order to get the path quickly, you can refer to the 3 methods below. On the other hand, if there are many Excel files with the same name in different paths, you will still need to select them one by one. You can certainly use the search feature in your computer.īut if there are many files in your computer, you need to spend a lot of time on the search process. However, if you close the folder and couldn’t remember the exact location, you will find it hard to get the path especially, especially when there are many files in your computer. Getting the path of the current workbook seems to be very easy. In this article, we will show you 3 methods to get the path. When you are working on an Excel workbook, you may need to refer to the path of this file.
0 Comments
Leave a Reply. |