Home |
Search |
Today's Posts |
#1
|
|||
|
|||
extend mode with Find Next
Is it possible to use Extend mode with Find Next? In a macro I'd like to
start with cursor on A1, then using Find Next, extend the selection down to the cell which has my target text in it. But I can't find a way to extend the selection all the way down there. Any ideas? Thanks, Harold |
#2
|
|||
|
|||
Maybe something like:
Option Explicit Sub testme() Dim FoundCell As Range Dim whatToFind As String Dim wks As Worksheet Set wks = Worksheets("sheet1") whatToFind = "SomeWord" With wks Set FoundCell = .Cells.Find(what:=whatToFind, _ after:=.Cells(1), LookIn:=xlValues, lookat:=xlWhole, _ searchorder:=xlByRows, searchdirection:=xlNext, _ MatchCase:=False) If FoundCell Is Nothing Then MsgBox "No " & whatToFind & "'s were found" Else Application.Goto .Range("a1", FoundCell) End If End With End Sub I looked for the whole cell and didn't care about matching case. HGood wrote: Is it possible to use Extend mode with Find Next? In a macro I'd like to start with cursor on A1, then using Find Next, extend the selection down to the cell which has my target text in it. But I can't find a way to extend the selection all the way down there. Any ideas? Thanks, Harold -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mode Function with Criteria | Excel Worksheet Functions | |||
Using the Find tool in EXCEL | Excel Worksheet Functions | |||
How do I find a mode while disregarding a specific cell value? | Excel Worksheet Functions | |||
Excel has a "Find Next" command but no "Find Previous" command. | Excel Discussion (Misc queries) | |||
coverting answer from Radian mode to degree mode | Excel Worksheet Functions |