View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Tricky problem in Data validation - Excel 2003


There are certain columns which are mandatory, how can i enforce that a
cell is not left blank?


With a change event:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then '2 for column B, CHANGE as necessary
If IsEmpty(Target) Then
MsgBox "Mandatory!"
Application.EnableEvents = False
Target.Select
Application.EnableEvents = True
End If
End If
End Sub

How can i force that data entered is numerical only?

select say column B,
Validation/Custom/Formula: =ISNUMBER(B1)

Regards,
Stefi