0
A
回答
0
这是我建立的功能。它返回找到所需值的联合范围:
Private Function FindRange(what As String, lookin As Range) As Range
Dim cell As Range
On Error GoTo errhandler
For Each cell In lookin.Cells
If UCase(cell.Value) = UCase(what) Then
If findrange Is Nothing Then
Set findrange = cell
Else
Set findrange = Application.Union(findrange, cell)
End If
End If
Next cell
Exit Function
errhandler:
findrange = CVErr(xlErrNA)
End Function
0
请尝试下面的代码。您可以使用公式在单元格中获得结果。
=findvalueandrange(searchstring,selectyourrange)
Public Function findvalueandrange(findingtext As String, r As Range) As String
Dim cell As Range
For Each cell In r.Cells
If LCase(cell.Value) = LCase(findingtext) Then
If findvalueandrange = "" Then
findvalueandrange = cell.Address & ":" & cell.Value
Else
findvalueandrange = findvalueandrange & "|" & cell.Address & ":" & cell.Value
End If
End If
Next cell
End Function
希望你满意?
相关问题
- 1. 查找值范围在MySQL
- 2. 查找范围内的值
- 3. 查找范围
- 4. SQL查找范围
- 5. 查找范围内的范围值之和数量
- 6. 查找范围和返回范围值到不同的表
- 7. 查找范围哪一个值存在
- 8. 查找范围中的下一个值
- 9. 在两个范围内查找值
- 10. 查找范围+循环的值
- 11. 在值中查找范围谎言
- 12. 使用Datediff查找范围值
- 13. 在范围字典中查找值 - python
- 14. 使用范围值与查找
- 15. 查找值的范围在每
- 16. 查找范围内的最小值
- 17. 查找并选择范围内的值
- 18. 根据范围数据查找值
- 19. VBA查找 - 查找范围错误
- 20. 在范围中查找列
- 21. 查找ASCII字符范围
- 22. 查找范围SQL复制
- 23. 查找指定的范围
- 24. 查找属性范围
- 25. 查找C中的范围
- 26. 查找重叠范围和
- 27. 查找并标记范围
- 28. vba动态查找范围
- 29. 查找和天数范围
- 30. PHP - 查找基于范围