Results 1 to 6 of 6

Error Handling via IF/Then Statement

Threaded View

HTMLGhozt Error Handling via IF/Then... 06-26-2015, 04:09 PM
gmr4evr1 Re: Error Handling via... 06-26-2015, 04:21 PM
HTMLGhozt Re: Error Handling via... 06-26-2015, 04:32 PM
HTMLGhozt Re: Error Handling via... 06-26-2015, 04:40 PM
gmr4evr1 Re: Error Handling via... 06-26-2015, 04:49 PM
HTMLGhozt Re: Error Handling via... 06-26-2015, 05:01 PM
  1. #1
    Registered User
    Join Date
    06-11-2015
    Location
    Phoenix, Arizona
    MS-Off Ver
    2007
    Posts
    6

    Error Handling via IF/Then Statement

    I'm attempting to create a notification board if a1 <1 then produce a message in the box. Suggestions for a better way of doing this?

    Option Explicit
    Public TermMsg As String, IDMsg As String, FNLNMsg As String, CovCodeMsg As String, EffDateMsg As String
    Sub example
    if range("A1").value >1 then
    TermMsg = "False
    else
    TermMsg = "True"
    end sub
    
    Sub test()
    Dim msgboxmsg As String
    Dim errorbox As String
    
    If TermMsg = "True" Then
        msgboxmsg = msgboxmsg & " Processed Term Date (MM/DD/CCYY)" & vbNewLine
    End If
    If IDMsg = "True" Then
        msgboxmsg = msgboxmsg & " Member ID" & vbNewLine
    End If
    If FNLNMsg = "True" Then
        msgboxmsg = msgboxmsg & " First Name or Last Name" & vbNewLine
    End If
    If CovCodeMsg = "True" Then
        msgboxmsg = msgboxmsg & " Coverage Code" & vbNewLine
    Else
    End If
    If CovCodeMsg = "True" Then
        msgboxmsg = msgboxmsg & " Original Effective Date (MM)" & vbNewLine
    End If
    If msgboxmsg <> vbNullString Then
        errorbox = MsgBox("Could not find columns:" & vbNewLine & vbNewLine & msgboxmsg, vbOKCancel)
    End If
    Exit Sub
    End Sub
    Last edited by HTMLGhozt; 06-26-2015 at 04:35 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error handling inside error handling
    By grantastley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2015, 03:43 AM
  2. [SOLVED] Error Handling: Creating code to display error messages
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2013, 02:21 PM
  3. Error Handling: Can it report line # where error occurred?
    By PingPing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2010, 03:47 AM
  4. Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM
  5. Error handling with a handling routine
    By ben in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2005, 11:06 AM

Tags for this Thread

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