how do i require text in a cell

  • Thread starter Thread starter how to make a cell require text
  • Start date Start date
H

how to make a cell require text

i am makeing a worksheet and i need t know how to make a cell where it
requires a text input before it will allow you to go to another cell. I have
questions on a sheet that i want to make have answers manditory before it
will let someone go on to the next question.
 
Select the cell, do data>validation, under allow select custom and then use
this formula


=ISERROR(1*A1)


under error alert type in a message that will pop up if someone tries to
enter a number

It won't work if someone pastes in a value


--


Regards,


Peo Sjoblom

"how to make a cell require text" <how to make a cell require
(e-mail address removed)> wrote in message
news:[email protected]...
 
Say your questions are in Column A and you want an answer in Column B before
moving on to next answer.

You can ask them or remind them but forcing is another matter.

Gets kinda complicated and requires event code when you need to force users
to complete a questionnaire.

I would create a Template with the questions but no answers and some sheet
event code to remind them to fill in the answers in column B.

Users would open a new workbook from the Template

This sample event code behind the question sheet would serve as reminder to
fill in the answers.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const myRange As String = "B1:B10"
Dim rng1 As Range
Set rng1 = Me.Cells(Rows.Count, 2).End(xlUp) _
.Offset(1, 0)
If Intersect(Target, Me.Range(myRange)) Is Nothing Then
MsgBox "Stay in column B and complete the answers"
rng1.Select
End If
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
If Target.Offset(-1, 0).Value = "" Then
MsgBox "You forgot to fill in " & rng1.Address
rng1.Select
End If
End If
endit:
Application.EnableEvents = True
End Sub

To be sure you would have to add more event code to prevent saving or
closing if all cells were not filled.


Gord Dibben MS Excel MVP
 
Back
Top