I'm trying to write a VBA script that will try to find a stringin Row "B" of "Sheet1".VB Code:
Essentially, I'm trying to do data entry validation for the worksheet, and I need to make sure the record doesn't already exist. Soooo...
I've created a form with a button to "search". I'd like the search to go through every record in "Sheet1" , Column "B" to see if any of the text matches the string strtemp. If it does, I would like it to "jump" to that row and prompt for a "continue/cancel".
If the user presses continue, keep searching until the last row is reached.
If the user presses cancel, bomb out.
Can someone help me with this? I'm desperate!
So far, my meager attempt is:
- Dim tempSMTP As String
- tempSMTP = txtSMTP.Text
- 'test code
- 'MsgBox "Searching for... " & tempSMTP & ".", vbOKOnly
- With Worksheets("Sheet1").Range("B:B").Find(tempSMTP, LookIn:=xlValues)
- End With