Here's the code:
Private Sub Worksheet_Change(ByVal IncurredTC100 As Range)
If Application.ActiveCell = "Milestone" Then
Application.ActiveCell.Offset(1, 0).Select
Application.ActiveCell.Offset(0, 1).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=MilestoneDrop1"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Invalid Entry"
.InputMessage = ""
.ErrorMessage = _
"You must select a year from the list. These numbers are generated from the data you entered on the Study Specifications sheet under ""d. Key Project Dates."" Push cancel and try again."
.ShowInput = False
.ShowError = True
End With
Application.ActiveCell.Value = 1
Application.ActiveCell.Offset(1, 0).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=MilestoneDrop2"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = False
.ShowError = False
End With
Application.ActiveCell.Value = 1
Application.ActiveCell.Offset(-1, 0).Select
Else
Application.ActiveCell.Offset(1, 0).Select
Application.ActiveCell.Offset(0, 1).Select
Application.ActiveCell.Validation.Delete
Application.ActiveCell.FormulaR1C1 = False
End If
End Sub
In case you're wondering, the reason I've used two Offset commands is because of merged cells. It might make more sense if you saw the xls.
When it runs, the word "False" cascades diagonally down to the right for hundreds of cells, but the error is underneath the Else section. Everything under If/Then works fine.
The other strange thing is that if I type anything in any cell in the worksheet (even outside the range defined in the macro), the word "False" cascades from that cell diagonally down to the right.
Any suggestions?
Bookmarks