Thread: Find troubles
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 195
Default Find troubles

David wrote

I want to select a student name from AE3 Data Validation dropdown and
class from AF3 Data Validation dropdown and wind up activating the
class under the student name.

This finds the student name, but stops the
Sub FindClass()
Dim ThisClass, FoundClass As Range
Columns("A:A").Find(Range("AE3")).Activate
ThisClass = Range("AF3").Value
Set FoundClass = Selection.Find(What:=ThisClass, _
After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
End Sub


Fumbled around and came up with this:
Sub FindClass()
Dim ThisClass As String, Rng As Range
Columns("A:A").Find(Range("AE3")).Activate
ThisClass = Range("AF3").Value
Set Rng = Range(ActiveCell.Address, Range(ActiveCell.Address).End(xlDown))
Rng.Find(ThisClass).Select
End Sub

Works, anyway.

--
David