Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
I have the following code that I want to run once in Col C of sheets 'Training Log' and 'Training 1981-1997', which creates a validation input msg ""Double click for lifetime mileage total up to this date" in the rows where Col 9 starts with the text string "Day"
Can you please tell me if there are any obvious errors in this code?
Many thanks!
I have the following code that I want to run once in Col C of sheets 'Training Log' and 'Training 1981-1997', which creates a validation input msg ""Double click for lifetime mileage total up to this date" in the rows where Col 9 starts with the text string "Day"
VBA Code:
Sub InsertValidationInput
If ActiveSheet.Name = "Training Log" and "Training 1981-1997" and If target.Column = C And Left(target.Value, 3) = "Day" Then
Application.EnableEvents = False
With Selection.Validation
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = False
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = "Double click for lifetime mileage total up to this date"
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
Application.EnableEvents = True
End With
End Sub
Can you please tell me if there are any obvious errors in this code?
Many thanks!
Last edited: