Skip to main content

How To Name a Workbook With the Text in a Cell || Save the Workbook with the cell Name using VBA


Hello Friends, Welcome to dptutorials.

If you want to save your excel workbook using the text in a specific cell as a filename, you need to watch this tutorial.

Click on the cell B2, enter some text and save it, you can see the file name as same as cell B2.


Let us learn this trick now, how to Name a Workbook with the Text in a Cell

Step1: Right click on sheet1 tab and select the view code option or else press Alt+F11 as a shortcut to go to VBA window.

Step2: Insert module and copy this code

Sub SaveAsCell( ) Dim strName As String On Error GoTo InvalidName strName = Sheet1.Range("B2") ActiveWorkbook.SaveAs strName Exit Sub InvalidName: MsgBox "The text: " & strName & _ " is not a valid file name.", vbCritical, "dptutorials.com" End Sub


Step3: And paste it here in the VBA window


Step4: Close this VBA window and go back to the Excel sheet.


Step5: From the menu bar, go to view tab and under macros, click on view macros

Step6: Select the SaveAsCell macro and click on Run and your workbook will automatically be saved as cell B2 of Sheet1.

Try to change the name in the cell B2 and save it, you can see the name of the file keeps changing and saving as a separate workbook in the same folder.


I hope this trick is very useful.


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. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
    Project Management Apps

    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.7 : User Defined Fields

Apart from the in-built fields available in primavera, you can create User-defined fields which enable you to customize fields and values and add them to the project database. For example, you can use them to track additional activity data such as ordered dates, delivery dates, revised budgets, purchase order / work order numbers, vendor names, etc. In this chapter, let us learn how to create User defined fields, how to work with them and how to work with indicators type of User defined fields. How to Create UDFs? For each custom user defined field you create, you can specify any of the following data formats for that field: Text, Start Date, Finish Date, Cost, Integer, Number, Text, and Indicator. To Define: Go to the Menu bar, Choose Enterprise, select  User Defined Fields . Select the subject area to which you want to add a new field, then click  Add . Double-click in the Title column and type a name for the User Defined Field. Double-click in the Da...

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...