Skip to main content

How To Extract A Excel Workbook's Name and Path || How to retrieve the workbook’s name, filepath



Hello Friends, Welcome to dptutorials

If you want a cell to return the name of a workbook, or the workbook's filename and path.
Then this is the tutorial to watch out.

In this tutorial, let us use a small macro to retrieve the workbook’s name, file path, and sheet name.

We can do the same trick using the formulae.

Right click on the sheet tab and click on view code, or press Alt+F11 to go to VBA window.

Select insert, module

Copy this code and paste into this module,

Function WorkbookName() As String WorkbookName = ThisWorkbook.Name End Function Function Filepath() As String Filepath = ThisWorkbook.FullName End Function Function SheetName(rAnyCell) Application.Volatile SheetName = rAnyCell.Parent.Name End Function

Close this VBA window and go back to the Excel window.

Go to Formulas tab, click on insert function, under the category, and select the user-defined, you will find three functions Filepath, sheet name, and workbook name.

If you click on file path and click ok, you get the result in the selected cell.

Now, select the workbook name and click ok, you will get the file name in the selected cell.

If you select the sheet name function and click ok, you will get the result as “sample” which is exactly our sheet name.

So in this way you can make use of this macro, to extract the Excel Filename, full file path, and sheet name.

That’s it friends. If you have enjoyed this tutorial, please do give me a like & share and also you can comment for improvement. For further more interesting videos, please do subscribe dptutorials. Thanks for watching.

For Personalized detail learning, write to dptutorials15@gmail.com If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.

***************************************************************
Read my full article on this: http://ift.tt/2kB14dh
***************************************************************
Subscribe for more Awesome Tutorials: goo.gl/4T8ePc
***************************************************************
Support The Channel via shopping: http://ift.tt/2jH38PR
**************************************************************

You Can Connect With Me at
G+ : http://ift.tt/2kAOpa6
Twitter : https://twitter.com/dptutorials15
Facebook : http://ift.tt/2kfRnDi
Blogspot : http://ift.tt/2kB14dh

Comments

  1. I got here much interesting stuff. The post is great! Thanks for sharing it! PowerShell

    ReplyDelete

Post a Comment

Popular posts from this blog

How To Merge Two Separate Schedules Into One Master Schedule In Primavera

In this tutorial, let us learn how to Merge two separate schedules into One Master schedule in Primavera P6. In this example, I am considering two separate projects which are these two, One is master schedule and one is the subproject. First, let us open the subproject and export this schedule as a .XER file onto Desktop. and now let us start the exact process of merging two separate schedules. 1. As a first step, We need to open the project schedule into which we want to insert the other project as a sub-project. So, let us open the Master schedule here. 2. Go to Import, select XER format, Click Next 3. Select Project and click Next 4. Now select the Subproject .xer file from the Desktop and click Next 5. Under Import action, select the option as “Update Existing Project” and under import to section, select the Master schedule which is already open. Click Next and Finally Click on Finish. 6. Please note and make sure that your WBS and activity IDs should not confl...

Primavera P6 Tutorial : Chapter 2.5 : Budgets

Budget Consists of quantities and cash flow required to complete a project. In the Planning stage project manager and other stakeholders need to estimate scope and budgets. As the scope changes, budget also needs to be adjusted to compensate. Primavera is helpful in establishing these budgets and tracking the changes in the budgets. In this Tutorial, let us learn how to establish budgets, establish monthly spending plans, implement changes to it and tracking monthly spending and variances right from EPS to Project and to WBS level. In the planning stage, we start the budgeting from the top level, like dividing the budget available to the EPS nodes for the duration of the projects. And then respective managers divide this budget to the projects for which they are responsible in each EPS node. Let us consider with an example here. Considering that we have $6000 allotted for an EPS node and it is having two projects and we divide this $6000 equally to these two projects as $3000 eac...

Primavera P6 Export To Excel And Color WBS Levels Automatically || How To Color WBS Levels

In this tutorial, let us learn how to Color WBS levels after Primavera P6 Export To Excel. After exporting activity table from Primavera P6 to Excel, it’s very hard to tell which activity belong to which WBS. So in this tutorial, let us see how to color WBS levels automatically so we can have a report like in Primavera P6. This is my sample schedule in primavera, 1. I press Ctrl+A to select entire data and copy the data and then go to Excel sheet and paste it. 2. Add a column left to Activity Id i.e column A and name it as WBS level to show the WBS level for each activity. 3. enter the formula in Cell A2 as = =((FIND(TRIM(B2),B2))-1)/2 4. Hit enter and then apply the same formula to all the cells in column A to see WBS level for each activity. 5. See now, you can view the WBS level for each activity this way easily in Excel after exporting the Primavera P6 Schedule. And Now let us color the WBS levels. 1. Select the entire Data range. 2. Go to Conditional F...