## Excel VBA Find Next

Like in excel when we press CTRL + F a wizard box pops up which allows us to search a value in the given worksheet and once the value is found we click on find next to find the other similar value, as it is a worksheet feature we can also use it in VBA as Application property method as application.findnext for the same purposes.

Finding the specific value in the mentioned range is fine, but what if the requirement is to find the value with multiple occurrences. In one of the earlier articles, we have discussed the “Find” method in VBA, and it is not complex at all but finding all the repetitive occurrences is possible only with the “Find Next” method in excel VBA.

In this article, we will show you how to use this “Find Next” in Excel VBA.

### What is Find Next in Excel VBA?

As the word says, “Find Next” means from the found cell keep searching for the next value until returns back to the original cell where we have started the search.

This is the advanced version of the “Find” method, which searches only one time the mentioned value in the mentioned range.

Below is the syntax of the FIND NEXT method in Excel VBA.

**After: **It is the word that we are searching for.

### Examples of Find Next Method in Excel VBA

Below are the Examples of finding the next method in excel VBA.

For example, look at the below data.

**Step#1 –** In this data, we need to find the city name “Bangalore.” Let’s start the subprocedure in the basic visual editor.

**Code:**

Sub RangeNext_Example() End Sub

**Step#2 – **First, declare the variable as “Range” object.

**Code:**

Sub RangeNext_Example() Dim Rng As Range End Sub

**Step#3 – **Set the reference for the object variable as “Range(“A2: A11”).

**Code:**

Sub RangeNext_Example() Dim Rng As Range Set Rng = Range("A2:A12") End Sub

Since our data of the city list is there in the range of cells from A2 to A11 in this range, only we are going to search for the city “Bangalore.”

Since we set the range reference to the variable “Rng,” we use this variable instead of using RANGE(“A2: A11”) every time.

4.9 (1,353 ratings) 35+ Courses | 120+ Hours | Full Lifetime Access | Certificate of Completion

**Step#4 – **Use the RNG variable and open the Find method.

**Code:**

Sub RangeNext_Example() Dim Rng As Range Set Rng = Range("A2:A12") Rng.Find End Sub

**Step#5 – **The first argument of the FIND method is “What,” i.e., what we are trying to search in the mentioned range, so the value we are searching is “Bangalore.”

**Code:**

Sub RangeNext_Example() Dim Rng As Range Set Rng = Range("A2:A12") Rng.Find What:="Bangalore" End Sub

**Step#6 – **To show in which cell we have found this value declare one more variable as a string.

**Code:**

Sub RangeNext_Example() Dim Rng As Range Dim CellAdderess As String Set Rng = Range("A2:A12") Rng.Find What:="Bangalore" End Sub

**Step#7 – **For this variable, assign the found cell address.

**Code:**

Sub RangeNext_Example() Dim Rng As Range Dim CellAdderess As String Set Rng = Range("A2:A12").Find(What:="Bangalore") Rng.Find What:="Bangalore" CellAddress = Rng.Address End Sub

**Note:**RNG. Address because RNG will be having the reference for found value cell.

**Step#8 – **Now show the assigned cell address variable result in the message box in VBA.

Sub RangeNext_Example() Dim Rng As Range Dim CellAdderess As String Set Rng = Range("A2:A12").Find(What:="Bangalore") Rng.Find What:="Bangalore" CellAddress = Rng.Address MsgBox CellAddress End Sub

**Step#9 – **Run the code and see what we get here.

So we have found the value “Bangalore” in the cell A5. With the Find method, we can find only one cell, so instead of FIND, we need to use FIND NEXT in excel VBA.

**Step#10 – **We need to reference the range object variable but by using the FIND NEXT method in excel VBA.

**Code:**

Sub RangeNext_Example() Dim Rng As Range Dim CellAdderess As String Set Rng = Range("A2:A12").Find(What:="Bangalore") Rng.Find What:="Bangalore" CellAddress = Rng.Address MsgBox CellAddress Set Rng = Range("A2:A12").FindNext(Rng) End Sub

As you can see above, we have used the VBA FIND NEXT method, but inside the function, we have used a range object variable name.

**Step#11 – **Now again, assign the cell address and show the address in the message box.

**Code:**

Sub RangeNext_Example() Dim Rng As Range Dim CellAdderess As String Set Rng = Range("A2:A12").Find(What:="Bangalore") Rng.Find What:="Bangalore" CellAddress = Rng.Address MsgBox CellAddress Set Rng = Range("A2:A12").FindNext(Rng) CellAddress = Rng.Address MsgBox CellAddress End Sub

**Step#12 – **Run the macro and see what we get in the first message box.

**Step#13 – **The first message box shows the value “Bangalore” found in the cell A5. Click on the Ok button to see the next found value.

The second value found in A7 cell, press Ok to continue.

#### VBA Find Next (Using Loop)

It will exit the VBA subprocedure, but we are one more to be found in cell A10. When the values are to be found in more than one cell, then it is a better idea to use loops.

In this case, too, we have value “Bangalore” in more than one cell, so we need to include loops here.

**Step#14 – **First, declare two variables as the range.

**Code:**

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range End Sub

**Step#15 – **Set the reference for the first variable, as shown below.

**Code:**

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range Set Rng = Range("A2:A11").Find(What:="Bangalore") End Sub

**Step#16 – **For the second variable, set the reference by using the FIND VBA function.

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range Set Rng = Range("A2:A11").Find(What:="Bangalore") Set FindRng = Rng.FindNext("Bangalore") End Sub

**Step#17 – **Before we start searching for the value, we need to identify from which cell we are starting the search, for that declares the variable as a string.

**Code:**

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range Set Rng = Range("A2:A11").Find(What:="Bangalore") Set FindRng = Rng.FindNext("Bangalore") Dim FirstCell As String FirstCell = Rng.Address End Sub

**Step#18 – **For this variable, assign the first cell address.

**Code:**

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range Set Rng = Range("A2:A11") Set FindRng = Rng.Find(What:="Bangalore") Dim FirstCell As String FirstCell = Rng.Address End Sub

**Step#19 – **Now, we need to include the “Do While” loop to loop through all the cells and find the searching value.

**Code:**

Sub RangeNext_Example1() Dim Rng As Range Dim FindRng As Range Set Rng = Range("A2:A11").Find(What:="Bangalore") Set FindRng = Rng.FindNext("Bangalore") Dim FirstCell As String FirstCell = Rng.Address Do Loop While FirstCell <> Cell.Address End Sub

Inside the loop, mention the message box and VBA FIND NEXT method.

**Step#20 – **Below is the complete code for you.

**Code:**

Sub FindNext_Example() Dim FindValue As String FindValue = "Bangalore" Dim Rng As Range Set Rng = Range("A2:A11") Dim FindRng As Range Set FindRng = Rng.Find(What:=FindValue) Dim FirstCell As String FirstCell = FindRng.Address Do MsgBox FindRng.Address Set FindRng = Rng.FindNext(FindRng) Loop While FirstCell <> FindRng.Address MsgBox "Search is over" End Sub

**Step#21 – **This will keep showing all the matching cell addresses, and in the end, it will show the message as “Search is Over” in the new message box.

### Things to Remember

- FIND method can find only one value at a time.
- FIND NEXT in excel VBA can find the next value from the already found value cell.
- Use the Do While loop to loop through all the cells in the range.

### Recommended Articles

This has been a guide to VBA FIND NEXT. Here we discuss how to find the specific value using excel VBA findnext function along with examples. You can learn more about VBA functions from the following articles –

- 35+ Courses
- 120+ Hours
- Full Lifetime Access
- Certificate of Completion