我使用此代码查找范围内的某个值。如果搜索的值是单个数字或文本,这可以正常工作。每当搜索到的值为两位数时,我都会收到“错误 91 对象变量或未设置块”。谁能告诉我出了什么问题?为了清楚起见,我在这里上传了文件:https ://www.dropbox.com/s/5nkja2xumcyap73/Find%20error%2091%20for%20double%20digits.xlsm 非常感谢任何帮助!
Dim search_range As Range
Dim search_start As Range
Dim search_value As Range
Set search_range = shDaten.Range("E1:T1")
Set search_start = shDaten.Range("E1")
Set search_value = search_range.Find(What:=shSchl.Range("D25").Value, After:=search_start, _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)