How can I perform continuous search using Find and FindNext methods in Excel

0
120
How can I perform continuous search using Find and FindNext methods in Excel

Excel is a great tool with a lot of features, from creating random numbers to being able to perform a continuous search.

And it is that, when you have a sheet that is too long, with a large amount of information, it is useful to be able to use a shortcut and find something between all that.

Plus, it’s so much better when you can keep searching without having to type the command over and over again in Excel.

This makes the job a lot easier, so it’s a relief that this spreadsheet has features to help you find any data faster.

VBA macro

The methods to perform a continuous search require some “Programming” that can only be understood by reading the Excel book.

Or, you could take a content course, which can be done at the following link, where they have a whole library of material.

This will help you to program or code in the VBA to build and create a macro that will allow you to use the smart search methods. VBA is an object-oriented programming language in Excel, whose acronym stands for Visual Basic for Application which has many uses and properties.

So, to introduce it, within the program you have to go to the “Developer” tab, an action that will unlock a series of choices.

On the left side of that segment, you will find an option called “Visual basic” which must be pressed to continue.

There, a new window will open within the same spreadsheet, in which there will be a left location element and a blank screen.

computer screen with excel

To continue, you must choose the file or document name from the aforementioned bar, and in the empty part of the middle write the macro.

In this place you can build the code that is needed depending on the case, or it can be taken from an example template from the internet.

With the condition that it is necessary to ensure that the example found adjusts to the need of the user’s requirement, so that there are no errors.

Use only the Find method

In this part of the guide, we will only run the Find method before setting up and performing a continuous search in Excel.

Once the macro has been adjusted within the spreadsheet’s VBA, it will be possible to proceed with the simplest procedure.

It is then that you have to go to the “Developer” tab again, and identify a button with the name “Macros”.

Clicking on this will display a list of all items of this nature added to the existing spreadsheet.

Since there is only one in this case, it is the one that will be chosen and clicked on “Execute”, which will show a box where you can write. In this way, you write anything that can help identify the value you want to find in Excel.

various excel devices

This can generate a series of reactions, which will depend on the configuration of the macro that has been placed on the sheet. In most cases it results in the underlined value of some specific color.

Use FindNext method to perform a continuous search

Thus, by means of this technique it will be possible to carry out a continuous search for the one that has already been executed by the previous method.

This way, when the macro is used, it will allow you to underline or select other values ​​that may have a match to the first one and the search suggestion.

It does this by saving the first choice or result found and, through a loop, continuing to find more values.

To do this, you have to go back to the VBA editor and modify a bit the structure of the macro used to make the first medium.

Within it, a conditional must be placed that says that as long as the value is similar to another, it must be taken in the same way. And another one that makes the loop not continuous, and that the time comes when, when there are no more matches, it must stop.

You can use macros in Excel for anything you want, whether it’s for a simple task like copying and pasting cells or a more complex one like searching for words in an interval or range of cells.

Previous articleHyundai i20 or Peugeot 208, which one to buy in 2022?
Next articleEverything ready on May 7 and 8 for the Adventure Experience 2022

LEAVE A REPLY

Please enter your comment!
Please enter your name here