Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011

    Unanswered: Restrict Range to one cell entry

    I have a simple personal inventory spreadsheet with a four columns 24 rows (grouping of four). How can I force the user to make one entry per range?

  2. #2
    Join Date
    Jun 2012
    Greyton, South Africa

    At what point do you want this validated?

    This function can be used to check whether not only one entry exists in each aera.

    Public Function TestEntries(ByVal rngAreas As Range) As Boolean
        Dim rngArea As Range
        Dim blnResult As Boolean: blnResult = True
        Set rngAreas = Range("A1:D24, A25:D48, A49:D72, A73:D96")
        For Each rngArea In rngAreas.Areas
            blnResult = CBool(Application.CountA(rngArea) * blnResult)
            If blnResult = False Then Exit For
        Next rngArea
        TestEntries = blnResult
    End Function
    But how you apply it is up to you.

Posting Permissions

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