The following is the basic structure of looping through rows of data in a worksheet.
The following works with the Active Sheet.
But often one needs to work on some other worksheet.
The following is basically the same code as above, except it is used with a particular worksheet.
Note the use of the dot operator.
The next piece of code illustrates how to use Find.
If you only need to find one item in a range, then you wont need:
The above is for finding an item many times in a range.
Often I just copy and paste the following into my code:
Then I make modifications to the above depending on what I'm doing.
The line:
Is a double negative. It mean: If item was found!
If you want to know if it wasn't found:
The above line means: If item wasn't found!
If you need to know the row of the item found, use: rgCell.Row
Bookmarks