Macros & Excel VBA

How to Compare Dates to Today with Excel VBA – 3 Methods

The following sales dataset contains the amounts of sales and the date. To compare the dates to the current date: Press ALT+F11 to ...

Excel VBA: Copy Range to Clipboard (7 Suitable Examples)

How to Enable the Clipboard Shortcut in Excel Steps Go to the Home tab on the ribbon. Select the dialog launcher arrow from the ...

Excel VBA: Clear Contents If Cell Contains Specific Values

In this article we will demonstrate how to use VBA code to clear the contents of a cell if it contains various content, such as a numeric value, ...

How to Find a String in a Column and Return a Row Number Using VBA (6 Methods)

Method 1 - Returning Row Number Based on a String Open the VBA Window: Go to the Developer tab on the Excel ribbon. Select Visual ...

How to Get Row Number from Range with Excel VBA (9 Methods)

Method 1 - Get Row Number from Range Steps Open the VBA window by going to the Developer tab and selecting Visual Basic. Insert a new ...

Excel VBA Copy Cell Value to Clipboard: 4 Methods

Method 1 - Copying a Specific Worksheet’s Cell Value to Clipboard in Excel VBA Step 1: Type the following macro in the inserted Module. Sub ...

Open Workbook with Variable Name Using VBA in Excel: 4 Easy Ways

Method 1 - Using Workbook.Open Property 1.1 Open Workbook Mentioning File Path Steps We have a file stored in the documents folder to open. ...

How to Clear Cells in Excel VBA (9 Easy Methods)

The following dataset has the Product and Sales columns. We will clear some cells with VBA. Method 1 - Using the VBA Clear Command in ...

How to Create a Table with Headers Using Excel VBA (2 Methods)

  We made a survey and want to store some respondent information. We need the column headers like in the following picture. Method ...

How to Save Excel Macro Files with Filenames from Cell Values (2 Methods)

Dataset Overview To demonstrate the methods, we have taken the following dataset of the Sales history of some products in a shop. Method ...

Excel VBA to Save Workbook in Specific Folder with Date

We often need a distinct name to save our Excel files. This allows us to find our desired file among many other files. What could be more distinct ...

How to Use Arrays Instead of Ranges in Excel VBA

An object that is a collection of random elements is called an array. When an item knows how to move from one end to the other without having to list ...

Using Excel VBA to Return the Row Number of Value – 5 Methods

Method 1 - Using the Input Box Enable the Developer tab on the ribbon. Click: How to Show the Developer Tab on the Ribbon. Steps Go to the ...

Using Excel VBA to Save a Workbook as a New File in the Same Folder – 3 Examples

The sample Excel workbook contains 3 worksheets: ‘VBA-1’, ‘VBA-2’ and ‘VBA-3’. Each worksheet contains the same dataset (B4:D8). To save a new ...

How to Clear Contents Without Deleting Formulas Using VBA in Excel: 4 Methods

Method 1 - Clear Contents from Range Without Deleting Formulas Using VBA in Excel STEPS: Go to the Developer tab and select Visual Basic. It ...

Close the CTA

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo