'Move to next cell in active row with certain cell value
I am trying to select the next cell in a range which is based on the currently selected row that has the value " " (every cell contains an equation, some resulting in " " being the resulting cell value). The range runs from column F - Column YW.
I have started with the following code. Right now it correctly identifies the current row, but moves to column YW, every time, not finding blanks in the intermediate.
Sub JumpColumns()
Dim lnRow As Long
Dim strSearch As String
Dim ws As Worksheet
Dim searchrange As String
'Dim strAddress As String
Dim rngFound As Range, rngCell As Range
Set ws = Sheets("MP_MacroPractice")
lnRow = ActiveCell.Row 'sets row of search to currently active row.
Let searchrange = "F" & lnRow & ":" & "YW" & lnRow 'sets range to search in
Set rngSearch = Range(searchrange) 'sets range to search in
strSearch = " " 'sets string to search for
'Attempted loop to identify the next cell with a value of the search term:
For Each rngCell In rngSearch
Set rngFound = rngCell.Find(What:=strSearch)
Next
rngFound.Select
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
