I am getting "Run-time error '91': Object variable or With block variable not set" on the marked line:
Dim oFCWS As Worksheet
Set oFCWS = Worksheets.Item("Flashcard Practice")
tValueToFind = oFCWS.Range("B4").Value
Dim oWStoSearch As Worksheet
Set oWStoSearch = Worksheets.Item(oFCWS.Range("B3").Value)
Dim rAllCells As Range
rAllCells = oWStoSearch.Cells '*** ERROR LINE ***
Dim rCell As Range
rCell = rAllCells.Find(What:=tValueToFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
It seems that my types are right, and that oWStoSearch specifies a unique worksheet. Even so, if it wants an object for oWStoSearch to dereference, I'm not sure how to do that. What am I doing wrong?
Bookmarks