Macros & Excel VBA

How to Check If a Workbook is Open and Close It Using Excel VBA (5 Methods)

In the following picture, you can see that we have several workbooks. We want to check if a workbook is open and close it using VBA. ...

[Fixed!] Method Open of Object Workbooks Failed (4 Solutions)

Solution 1 - Use GetOpenFilename Method To solve the problem of “method open of object workbooks failed”, you need to use VBA. Microsoft Visual ...

VBA Code to Convert XML to Excel: 2 Methods

Method 1 - Go to VBA Module In this step, we will show how to get into the VBA module. Enter a blank Excel sheet. Go to the Sheet Name ...

How to Use Macro to Save Excel File with New Name (5 Ways)

Method 1 - Keeping File in Current Location Press Ctrl+F11 to open the VBA. Go to the Insert option and select the Module. The VBA ...

How to ReDim Preserve a 2D Array in Excel VBA – 2 Methods

This is the sample dataset created from a 2D array with three rows and two columns. Method 1 - ReDim Preserve the Last Dimension of a 2D ...

How to Add a Named Sheet in Excel Using VBA (6 Methods)

To add a sheet with a specific name in Excel using VBA, we’ll utilize the Sheets object. Below is the fundamental VBA code snippet to achieve this: ...

Unable to Set the Visible Property of the Worksheet Class – 3 Solutions

  Sometimes trying to change the visible property in Microsoft Excel results in the error message "unable to set the visible property of the ...

How to Create a New Workbook and Name It Using Excel VBA (6 Methods)

Method 1 - Using the Add Method We'll use the below workbook with several Worksheets. In the first method, we will create a new workbook and name it ...

Excel VBA to Add Sheet If It Does Not Exist (with Quick Steps)

Excel VBA - Add Sheet If It Does Not Exist (A Quick View) Sub AddSheetIfNotExist() Dim addSheetName As String Dim requiredSheetName As String ...

How to Create a New Sheet from a Template Using a Macro in Excel – 3 Methods

Method 1 - Using a Button in a Template to Create a New Sheet There is only one worksheet Sheet1 in the workbook.   Step 1: Inserting ...

How to Add Sheet with Name from Cell Using Excel VBA

In this article, we will use the following dataset to demonstrate four methods to add a sheet with a name derived from a cell using Excel VBA. In the ...

[Fixed!] Sub or Function Not Defined in Excel VBA

‘Sub or Function not defined’ is a compilation error in Excel VBA, that is displayed whenever anything specified by name cannot be found. Before ...

How to Generate XML File from Excel Using Macro (3 Methods)

The first dataset lists the names that will be applied to the new XML files. This sample dataset will be converted to an XML file. ...

Automation of Bank Reconciliation with Excel Macros: 3 Quick Steps

Method  1 - Create Dataset with Proper Parameters Our dataset contains information about several Transactions, including the Cheque Book Number, ...

How to Insert Page Number Using VBA in Excel: 3 Macros

Method 1 - Insert a Page Number in a Footer Using Excel VBA Steps: Go to Insert, choose Text, and select Header & Footer. Scroll ...

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo