-
Mar 2nd, 2006, 10:31 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Excel VBA - Find Rows
Hello...
I'm trying to write a VBA script that will try to find a string in Row "B" of "Sheet1".
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:
VB Code:
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|