Excel VBA usedRange Property and reset usedRange

This tutorial explains how to use Excel VBA usedRange Property to find the last used row and column number, and reset usedRange. You may also want to read: Excel VBA custom Function last row and last column Excel delete blank rows and blank cells before import into Access Excel VBA UsedRange Property Excel VBA UsedRange is a worksheet Property, it returns the area Range bounded by first used cell and last used cell. "Used Cell" is defined as Cell containing formula, formatting, value th...
Read More

Excel VBA Workbooks.Add Method to create new workbook

This page explains Excel VBA Workbooks.Add Method, illustrate how to create new workbook in Excel VBA or move data from one workbook to a new workbook What does Excel VBA Workbooks.Add Method do? Excel VBA Workbooks.Add Method is used to create new workbook. Suppose you have a workbook called workbook1, inside workbook1 you need to create new workbook and manipulate it, then you need to insert the Workbooks.Add Method in workbook1. After you have created the workbook, the workbook becomes ac...
Read More

Excel VBA Formula Property of Range

This Excel VBA tutorial explains how to use Formula Property in Excel VBA. Formula Property in Excel VBA There are two functions for Formula Property: 1. To set formula in a Range, like the way you type a formula in worksheet 2. To retrieve formula from a Range Syntax of  Formula Property To set a formula: Range.Formula = "=your formula" To retrieve a formula: variableName = Range.Formula Remarks You can also set a formula using Value Property Range.Value = "=your formula" ...
Read More

Excel VBA delete worksheet based on worksheet name

Solution to delete worksheet based on worksheet name I am providing the solution for the "Deluxe-Plus" version in the below code To determine which worksheet is to delete, create an array called delWS(), and then loop through all the worksheet name to find the worksheet name that contains "DELETE" or "OLD". If (InStr(WS.Name, "DELETE") <> 0 Or InStr(WS.Name, "OLD") <> 0) And InStr(WS.Name, "KEEP") = 0 Instr function is to check whether the worksheet name contains the key w...
Read More