Results 1 to 3 of 3

Require Data To Be Entered In Cell Unless Selecting Specific Cells

Threaded View

  1. #1
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Question Require Data To Be Entered In Cell Unless Selecting Specific Cells

    I came across a problem with my workbook where the best solution I can think of would be this:

    I need to prevent data from being entered anywhere else on a worksheet unless Cell X1 receives data first - anywhere else, that is, except for Cells U6, O79, U86, O159, U166, and O239.

    How do I edit my existing code to do this?

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Application.EnableAutoComplete = IIf(Not Intersect(Range("A9:A76,A89:A156,A169:A236"), Target) Is Nothing, False, True)
        With Range("X1")
            If .Value = Empty Then
                Application.EnableEvents = False
                .Select
                MsgBox "Please enter the number of pages required before entering data elsewhere."
                Application.EnableEvents = True
            End If
        End With
    End Sub
    Last edited by swordswinger710; 06-08-2012 at 06:19 PM.
    There is so much good in the worst of us,
    And so much bad in the best of us,
    That it hardly behooves any of us
    To talk about the rest of us.

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