excel vba,查找某个单元格值所在的单元格

2024-11-26 03:18:37
推荐回答(2个)
回答1:

Sub Find_Fun()
Dim What As String
Dim n As Integer
What = InputBox("请输入查找内容", "查找功能")
n = 1
Do While n = 1
Set Rng = ActiveSheet.UsedRange.Find(What)
If Rng Is Nothing Then
MsgBox ("没有该值")
Else
MsgBox "查找值在:"&(Chr(64 + Rng.Column) & Rng.Row)
Rng.Select
n = n + 1
End If
Loop
End Sub

回答2:

excel自己不是有查找、定位的功能吗