Validating multiple cells before proceeding

tigerdel

New member
Joined
Aug 23, 2012
Messages
40
Reaction score
0
Points
0
Location
Cambridgeshire
Excel Version(s)
Office 365
I have built a validation so that if a user fails to answer a question then they cannot move to next screen and it works fine

My problem is that there are 10 questions on the page and I want to check that all questions have been answered and if not it changes the font to red and the user cannot connot until all questions are answered.

Once all question are answered the font returns to black and moves to next sheet

Any ideas please??

Code:
Sub NEXT2()
Dim celltxt As String
celltxt = ActiveSheet.Range("BG9").Text              ‘select cell
If InStr(1, celltxt, "FALSE") Then                        ‘check to see if it has this value
MsgBox ("Please answer Question 1")                  ‘if Yes then this message
ActiveSheet.Range("A9").Select                         ‘select question cell
Range("A9").Select                                          ‘select the cell
With Selection.Font                                                       
.Color = -16776961                                          ‘change font to red
.TintAndShade = 0
End With
Else
Range("A9:A22").Select
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0'
Sheets("TNA2").Select                                      ‘otherwise move to next sheet
Sheets("TNA2").Range("A1:E1").Select
End If
End Sub
 
Last edited:
Back
Top