Results 1 to 12 of 12

User Form to check data before closing form

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-30-2010
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    109

    User Form to check data before closing form

    I have a user form that when data entry is complete, I what to check that the values are correct. If they are not, I what the form to stay open, and messages to tell the user what to fix.

    How should I write the code this is what I have, & I'm not getting what I need?

    Private Sub Com_Apply_Click()
    'chech values
        If Range("d15").Value > Range("d16").Value = True Then
        MsgBox "Alignment Start Station must be equal to or less then Alignment End Station"
        
        Else
        Unload Me
        End If
        
        If Range("d15").Value > Range("d16").Value = True Then
        MsgBox "Alignment End Station must be equal to or Greater then Alignment Start Station"
        
        Else
        Unload Me
        End If
        
        If Range("E16").Value > 0 = True Then
        MsgBox "Alignment Offset Left must be less then -0"
        
        Else
        Unload Me
        End If
        
        If Range("F17").Value > "0" = True Then
        MsgBox "Alignment Offset Left must be Greater then 0"
        
        Else
        Unload Me
        
        End If
    
    End Sub
    Last edited by CityMPLSEmpolyee; 02-14-2012 at 02:56 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