Private
Sub
Worksheet_SelectionChange(
ByVal
Target
As
Range)
Dim
cat1
As
Range
Dim
cat2
As
Range
Dim
x
As
Integer
Set
cat1 = Range(
"G:G"
)
Set
cat2 = Range(
"H:H"
)
If
Not
Intersect(Target, cat2)
Is
Nothing
Then
If
ActiveCell.Value =
""
Then
If
Cells(ActiveCell.Row, 7).Value =
"Comms"
Then
With
Range(Cells(ActiveCell.Row, 8))
With
.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=
"=Codes!$J$5:$J$12"
.IgnoreBlank =
True
.InCellDropdown =
True
.InputTitle =
"Task performed"
.ErrorTitle =
""
.InputMessage =
"Please specify the task performed in detail"
.ErrorMessage =
""
.ShowInput =
True
.ShowError =
True
End
With
End
With
ElseIf
Cells(ActiveCell.Row, 7).Value =
"Donor"
Then
With
Range(Cells(ActiveCell.Row, 8))
With
.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=
"=Codes!$J$13:$J$19"
End
With
End
With
End
If
End
If
End
If
End
Sub