Created
May 11, 2019 02:21
-
-
Save DataSolveProblems/14ce61ff5d75feaafd9e9cb445b6b87b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Lookup_Demo() | |
| Dim ColorName As String, firstAddress As String | |
| Dim rangeLookup As Range, rangeOutput As Range | |
| Dim v As Range | |
| ColorName = "Red" | |
| Set rangeLookup = Range("C3:C8") | |
| Set rangeOutput = Range("D3:D8") | |
| Set v = rangeLookup.Find(ColorName) | |
| If Not v Is Nothing Then | |
| firstAddress = v.Address | |
| Do | |
| v.Offset(0, -1).Value = v.Offset(0, -1).Value + 100000 | |
| Set v = rangeLookup.FindNext(v) | |
| Loop While v.Address <> firstAddress | |
| End If | |
| '// Release object memory | |
| Set rangeLookup = Nothing | |
| Set rangeOutput = Nothing | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment