Hi All
I am looking for a simple bit of code to seach column D for a name and select the next cell in column E.
The data sould be validated so there are no duplicates, but the list will end up in excess of 1000 names so I would like a button at the top to prompt for a name, then auto search/select.
The below code doesn't seem to work as It only seems to find text cells, where as my data all refs other pages to I would need to search for the output value. I have tried looking for better code, but must be missing something because they all seem to work the same way.
Thank all again for the continued help.
I am looking for a simple bit of code to seach column D for a name and select the next cell in column E.
The data sould be validated so there are no duplicates, but the list will end up in excess of 1000 names so I would like a button at the top to prompt for a name, then auto search/select.
The below code doesn't seem to work as It only seems to find text cells, where as my data all refs other pages to I would need to search for the output value. I have tried looking for better code, but must be missing something because they all seem to work the same way.
Thank all again for the continued help.
Code:
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]Sub search()<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] Dim strFindName As String<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] <o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]strFindName = InputBox("Please enter NAME", "Search...")<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] <o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] On Error GoTo ERRORHANDLER<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]<o:p> </o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[B][I][FONT=Verdana][SIZE=2][COLOR=red][COLOR=red][FONT=Verdana][B][I]'cant find result, as its the value of calc, not text<o:p></o:p>[/I][/B][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I][/B]
[B][I][FONT=Verdana][SIZE=2][COLOR=red][COLOR=red][FONT=Verdana][B][I]'so need to search for value of cell only<o:p></o:p>[/I][/B][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I][/B]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]<o:p> </o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] Cells.Find(What:=strFindName, After:=ActiveCell, LookIn:=xlFormulas, LookAt _<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] False).Select<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] <o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[B][I][FONT=Verdana][SIZE=2][COLOR=red][COLOR=red][FONT=Verdana][B][I]'at this point I cant select the cell as it must remain locked (column D), I would like to select cell in Column E next to it<o:p></o:p>[/I][/B][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I][/B]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] <o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] Exit Sub<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]<o:p> </o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]ERRORHANDLER:<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I] MsgBox ("The NAME you are searching for cannot be found")<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]
[I][FONT=Verdana][SIZE=2][COLOR=navy][COLOR=navy][FONT=Verdana][I]End Sub<o:p></o:p>[/I][/FONT][/COLOR][/COLOR][/SIZE][/FONT][/I]