Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range.Find skips the first cell ??
I like to start after the last cell in the range and look for the next cell...
Something like: Dim myRng as range Dim FoundCell as range set myrng = worksheets("Sheet1").range("a1:z99") With myRng Set FoundCell = .Cells.Find(what:="what to look for", _ after:=.Cells(.Cells.Count), LookIn:=xlValues, _ lookat:=xlWhole, searchorder:=xlByRows, _ searchdirection:=xlNext, MatchCase:=False) End With slintz wrote: It seems that a straight forward Range.Find() call implicitly starts searching AFTER the first cell in the range, AS IF called as f = r.Find(after:=r.cells(1,1),...) This work-around is effective: f = r.find(after:=r.cells(r.Rows.Count, r.Columns.Count),...) but it's (obviously) fugly. Am I missing something? -- Dave Peterson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range.Find skips the first cell ??
Yeah, your solution is the same as mine - except yours is noticibly cleaner.
Despite being disgusted by this behavior I'm sure I can learn to make due <smirk. Thanks for your help! "Dave Peterson" wrote: I like to start after the last cell in the range and look for the next cell... Something like: Dim myRng as range Dim FoundCell as range set myrng = worksheets("Sheet1").range("a1:z99") With myRng Set FoundCell = .Cells.Find(what:="what to look for", _ after:=.Cells(.Cells.Count), LookIn:=xlValues, _ lookat:=xlWhole, searchorder:=xlByRows, _ searchdirection:=xlNext, MatchCase:=False) End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif skips cells in range | Excel Discussion (Misc queries) | |||
How do I set it so my tab key skips to the next cell not 6? | Excel Discussion (Misc queries) | |||
How do I set up a function that skips a cell in a fill? | Excel Worksheet Functions | |||
can't tab to next cell skips to end of line? | Excel Discussion (Misc queries) | |||
Range.Find skips the first cell ?? | Excel Programming |