1

I'm sure this is easy, but I can't seem to find an answer online other than GoTo Record which is not what I want.

Basically my VBA does a check to see if that unique key exists, if yes the it displays a message box and then I would like it to skip to the bottom of the code. Right now it just goes to the next line which starts adding the record.

Here's where I what I have right now:

With myR

    .FindFirst ("Username = '" & Me.UID & "'")

    If .NoMatch Then

    Else

        MsgBox "That username is already in the system."

        'Add skip to bottom code here 

    End If

End With

Thanks in advance

4

1 回答 1

2

除了我的评论

Sub Main()

    isA1Empty

End Sub


Private Function isA1Empty()
    With Sheets(1)
        If IsEmpty(.Range("A1")) Then
            MsgBox "empty"
            Exit Function
            Debug.Print "this will not be printed"
        End If
    End With
End Function
于 2013-09-25T12:07:10.390 回答