User Interface Protection
VBA

Protect Excel Worksheet as UserInterFaceOnly

Just assume you a worksheet wherein you have few groups for column or rows and then you protected that worksheet. Now will you be able to expand or collapse those groups? No, you cannot expand or collapse it because it will show error as worksheet is protected. [caption id="attachment_13217" align="aligncenter" width="1166"] How to expand or collapse group while worksheet is protected[/caption]   If your worksheet is protected and you want
Evaluate Formula
VBA

UDF for Evaluate a Formula in Excel

In this article you will learn how to create a User Defined Function to evaluate a formula in Excel. You will also learn how to get text of formula using a User Defined Function and FORMULATEXT (Excel 2013 and above). Below is the code to create the User Defined Function to evaluate a formula in Excel Function Evaluate_Formula(formula_text As String) As Variant      Application.Volatile     Evaluate_Formula = Application.Evaluate(VBA.Trim(formula_text))
Merge Same Cells
VBA

VBA: Quickly merge cells with same value in Excel

In this article you will learn how to quickly merge same cells in Excel using VBA. Using this VBA code, you can merge multiple columns data together. This trick can save a lot of time. Just select the range for which you want to merge the cells with same values and run this macro. You can copy this code to the personal macro so that it will available for every
Data Consolidator
VBA

Data Consolidation: Allow User to select files on Runtime

In this article you will learn how to consolidate the data from multiple excel files using Application.GetOpenFileName in VBA.  Application.GetOpenFileName is used to allow the user to select the files on run time. Below is the code to consolidate the data from multiple Excel files. Copy this code and paste it in VBA module. Data will be consolidated on “Data” worksheet of Macro File. Option Explicit Sub Consolidate_Data() Dim wb
Resize and Relocate Chart
Charts and Visualization VBA

Resize and Relocate the Chart using Excel Range

In this article you will learn a trick to resize and relocate a chart using VBA. We have created a shortcut key Shift+Ctrl+R to resize and relocate active chart. You just need to select the range and your selected chart will be relocated and resized according to selected range. You can move the chart to another worksheet also. Below is the VBA Code- Sub Resize_Chart() Dim cht As Chart On
Input box
VBA

VBA.Inputbox Vs Application.Inputbox in Excel VBA

In this article you will learn the use of VBA.Inputbox and Application.Inputbox in VBA. Input box is used to take the input from use on run time. VBA.Inputbox: To take the input form user we use the Inputbox or VBA.Inputbox. This input box looks like below image – [caption id="attachment_10540" align="aligncenter" width="373"] VBA.Inputbox[/caption]   Below is the Code for VBA.Inputbox- Sub VBA_Inputbox() Dim myinput As Variant myinput = VBA.InputBox("Input the
Create Multiple Folder
VBA

Create Multiple Folders from Excel Range

In the previous article you have learnt how to check the whether a folder exist or not. In this article you will learn we can create multiple folders on one click using excel range.   Below the VBA code to create multiple folder from excel sheet Option Explicit Sub Create_Multiple_Folder() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Sheet1") Dim sub_folder_path As String Dim i As Integer For i = 4
Folder Existence Function
VBA

Check Folder Existence using VBA

During the automating some task in VBA, many times we need to check that a folder is exits or not. For example if you want to create or delete a folder using VBA then you should check first whether that folder exits for not. If that folder exits then you take your next action. It method can prevent you from an error. In this article you will learn how to
Rename the Multiple files
VBA

Rename Multiple File on one click

In this article you will learn how to rename the multiple files available in a folder. In the previous post I have explained you how we can get the files information in a excel sheet. We will use the same method to get the current file names of given folder. Once we have the file names in the excel sheet then we will give new name in another excel column
Get File Information
VBA

File System Object: Get Files information in Excel

In this article you will learn how to get the files information from a folder like File Name, File Type, File size, Last modify date etc. in excel sheet. We will use the file system object to create this. To use the file system object you need to add “Microsoft Scripting Runtime” Reference. To add this Reference go to Visual basic editor > Tools > References > Microsoft Scripting Runtime