Results 1 to 11 of 11

Select case on range name

Threaded View

  1. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Select case on range name

    An example workbook would help. Are they all Named Ranges referring to single cells, if so you need to loop through the Names not the cells

    Maybe
    
    Option Explicit
    Sub VALIDATEINPUT()
        Dim Nm As Name
    
        For Each Nm In Names
            Select Case Nm.Name
    
            Case "EMP": If Range("EMP") = "" Then MsgBox ("You must enter an employee number at the top")
            Case "RES"
                If Range("RES") = "" Then
                    MsgBox ("You must select a reason for the change request")
                ElseIf Range("RES") = "Other - Please specify" Then
                    If Range("RESO") = "" Then
                        MsgBox ("You must enter a reason in the 'other reason' box")
                    End If
                End If
            End If
    'etc
    Last edited by royUK; 01-07-2011 at 01:22 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