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
I got here much interesting stuff. The post is great! Thanks for sharing it! PowerShell
ReplyDelete