Results 1 to 8 of 8

Code stop working after exit Sub

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Code stop working after exit Sub

    Good day everyone,
    I am having problem figuring out why my Excel stops working if a cell is empty. What is wrong?

    Private Sub CommandButton1_Click()
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    
    If IsEmpty(ActiveCell) Then
    MsgBox "Selected cell is empty. ", vbExclamation, "No Requisition Number"
    Unload Me
    Exit Sub
    End If
    
    'other codes here
    
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    
    End Sub
    The code just stop working after this is run without anything in the selected cell.

    Should I remove something...but what.

    The msg pops up but once I have selected "Ok" all codes in my workbook stops working.
    Last edited by Excelnoub; 05-29-2013 at 12:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1