snoopy80
Technical User
- Jun 27, 2001
- 106
Hello everyone,
I have a table with column A as index and column D alphabets as follow
A B C D
-----------------------------
1 a
2 b
3 c
4 d
and I have this macro:
Search = InputBox("Enter a letter for Search OR" & vbCrLf + vbCrLf & "Enter X to Cancel.", "Find What")
If (Search = "x") Or (Search = "") Then
Exit Sub
Else
Cells.Find(What:=Search, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End If
Now If I run this macro and enter "b", it will find the letter b in column D and so Cell D2 is activate. My question is when I enter "b" in the search, I want it to find b in column D but instead of activating cell D2, I want cell A2 (index column) to be active so I know b in located in that row. Thanks for helps.
I have a table with column A as index and column D alphabets as follow
A B C D
-----------------------------
1 a
2 b
3 c
4 d
and I have this macro:
Search = InputBox("Enter a letter for Search OR" & vbCrLf + vbCrLf & "Enter X to Cancel.", "Find What")
If (Search = "x") Or (Search = "") Then
Exit Sub
Else
Cells.Find(What:=Search, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End If
Now If I run this macro and enter "b", it will find the letter b in column D and so Cell D2 is activate. My question is when I enter "b" in the search, I want it to find b in column D but instead of activating cell D2, I want cell A2 (index column) to be active so I know b in located in that row. Thanks for helps.