Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
The following code in the worksheet_change event is triggered when any text value other than 'OTHER' and 'REST' is input in column B in the last filled row. The input text "Double click for lifetime mileage total up to this date" is then added to the validation in Column H.
I'm pretty close, but I can't quite get the first 3 lines right for the code to run.
Help would be appreciated.
Many thanks!
The following code in the worksheet_change event is triggered when any text value other than 'OTHER' and 'REST' is input in column B in the last filled row. The input text "Double click for lifetime mileage total up to this date" is then added to the validation in Column H.
VBA Code:
If target.Column = 2 And target.Value <> "OTHER" And target.Value <> "REST" Then
Application.EnableEvents = False
With Range("A23358").End(xlUp).Offset(1, 7).Validation
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator:=xlBetween
.InputMessage = "Double click for lifetime mileage total up to this date"
.ShowInput = True
End With
Application.EnableEvents = True
End If
Help would be appreciated.
Many thanks!