I am using excel 2007 and Windows XP.
I have created a data validation list; I would like to search a given range ie(B2:NXK2) for the value that I have selected from the data validation pull down menu.
I have used this code to search for the value when I type in the value in an input box. I would like to use the already populated data validation list to select the value rather than type the value manually. Have searched with nothing similar to what I am trying to do.
Sub Delete_Setup()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Select Setup to Delete")
If Trim(FindString) <> "" Then
With Sheets("Sim_Database").Range("B2:NXK2")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub
Thank you for any help, it is much appreciated!
I have created a data validation list; I would like to search a given range ie(B2:NXK2) for the value that I have selected from the data validation pull down menu.
I have used this code to search for the value when I type in the value in an input box. I would like to use the already populated data validation list to select the value rather than type the value manually. Have searched with nothing similar to what I am trying to do.
Sub Delete_Setup()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Select Setup to Delete")
If Trim(FindString) <> "" Then
With Sheets("Sim_Database").Range("B2:NXK2")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub
Thank you for any help, it is much appreciated!