Macros & Excel VBA

Excel VBA: Get Row and Column Number from Cell Address (4 Methods)

How to Write Code in the Visual Basic Editor To get row and column numbers from cell addresses, we need to open and write VBA code in the Visual ...

Excel VBA: Create New Line in MsgBox (6 Examples)

Example 1 - Use vbNewLine to Add New Line in MsgBox Using Excel VBA We will show “Hello!” in the first line and “Welcome to ExcelDemy” in the second ...

How to Separate Numbers from Text in Excel VBA – 3 Methods

Quick View Public Function SeparateText(Rng As Range, Number As Boolean) As String Dim a As Long Dim b As String a = VBA.Len(Rng.Value) For i = ...

Excel VBA: Set a Range by Row and Column Number – 3 Examples

This is a quick overview. Method 1 - Set a Range by Row and Column Number Using the Cell Address in VBA To set B4:D13, use ...

Excel VBA to Get Unique Values from Column (4 Examples)

We will use the following dataset to get unique values from a column. The dataset contains some products in column B and the country where the ...

How to Add Hyperlink to Cell Value in Excel Using VBA (4 Methods)

Method 1 - Embed VBA to Add Hyperlink from a Different Worksheet to a Cell Value in the Active Sheet Let’s consider the following dataset: In our ...

Excel VBA: Split Sheet into Multiple Sheets Based on Rows

The sample dataset below will be used for demonstration. Procedure 1 - Build the Code Press Alt+F11 on your keyboard to open the VBA ...

Excel VBA: Remove Duplicates Comparing Multiple Columns: 3 Methods

Method 1 - Remove Duplicates Comparing Specified Multiple Columns Using VBA in Excel Task: We want to remove duplicate students from the dataset by ...

Excel VBA: Remove Duplicates from an Array (2 Examples)

In this article, we'll demonstrate how to remove duplicates from an array using Excel VBA code. VBA Code Quick View Sub ...

Create a Table from Range in Excel VBA – 6 Examples

This is the sample dataset. Choose ListObjects.Add to turn a range into an Excel table. The criteria for .Add are the following: ...

Excel VBA: Set Print Area for Multiple Ranges (5 Examples)

In this article, we will discuss 5 examples related to setting the print area for multiple ranges using VBA in Excel. Example 1 - Print ...

Excel VBA: Random Number Generator with No Duplicates – 4 Examples

Enter a Code in the Visual Basic Editor To generate random numbers with no duplicates, open Visual Basic Editor and use a VBA code.  Go to ...

Excel VBA for Random Selection from List: 3 Easy Methods

Let’s get introduced to our dataset first, which represents some students’ IDs, Names, and Ages. Method 1 - Excel VBA to Select Only One ...

How to Generate Random Numbers in a Range with Excel VBA

Here's a quick overview of the code that assigns random numbers. Sub Random_Numbers_with_Rnd() Bottom = 11 Top = 20 Random_Number = ...

Insert a Column with a Name in Excel VBA – 5 Examples

Example 1 - Insert a Single Column with a Name in Excel Using VBA The following dataset showcases sales data in different cities and in different ...

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo