Hi,
I have a following code in my workbook
i want to add vbyesno code with
If rngFound Is Nothing Then
MsgBox "ID not Found, Want to Create?" vbyesno
PHP Code:
Private Sub cmdfndnext_Click() Dim strPrefix As String, strSuffix As String, strID As String Dim rngFound As Range, rngstart As Range Dim i As Long
strID = Trim(txtid.Text)
If cmdfndnext.Tag = "Next" Then Rem incriment ID number For i = Len(strID) To 1 Step -1 If Mid(strID, i, 1) Like "[!0-9]" Then strPrefix = Left(strID, i) strSuffix = Mid(strID, i + 1) If i < Len(strID) Then strSuffix = Format(Val(strSuffix) + 1, String(Len(strSuffix), "0")) End If Exit For End If Next i strID = strPrefix & strSuffix txtid.Text = strID
End If
With Sheets("Life Member").Range("A:A") On Error Resume Next Set rngFound = .Find(txtid.Text, After:=.Cells(Rows.Count, 1), Lookat:=xlWhole, LookIn:=xlValues, MatchCase:=True) On Error GoTo 0 End With
Bookmarks