the strikes are auto inserted when copy paste. don't know why that is
The below code is forcing a user to input a specific format for Latitude and Longitude into a cell and is separate from what I additionally need for the earlier explained value.
If I paste the code you gave me into the below code - I get the ambiguous name error. I understand that there cannot be 2 worksheet_change events in one sheet, but when I try to insert your code in mine, it comes back with all sorts of errors, mainly with some statements already mentioned.
But if you check this yourself you will see for sure.
Your code on an empty sheet works fine - and that is what I checked earlier
But comined with other codes I cannot get it to work
So, I am looking to insert your code to ensure that users are aware of the fact that the value in the cell F24 is 12 or more (with the option to leave it lower if required)
The value of cell F24 is determined by Cell F20/F22
Note that all this information, both the values of the below code for lat/long and the value mention above - is displayed in one and the same column (F) in my excel form
What is the significance of the strike through text?
the code what is in the page is:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge = 1 And Not Intersect(Range("F15:F16"), Target) Is Nothing Then
On Error GoTo Escape
Application.EnableEvents = False
Target = Trim(VBA.UCase(Target.Value2))
Target.Replace ",", "."
If Target.Address = "$F$15" Then
If Not Target Like "##-##.# [N]" And Not Target Like "##-##.#
" Then
MsgBox "Latitude must be entered in the format 00-00.0 N (or S)"
Target = "00-00.0 N"
GoTo Continue
End If
If Left(Target, 2) > 90 Then
MsgBox "Maximum allowable values are: 90-99.9"
Target = "00-00.0 N"
GoTo Continue
End If
End If
If Target.Address = "$F$16" Then
If Not Target Like "###-##.# [E]" And Not Target Like "###-##.# [W]" Then
MsgBox "Longitude must be entered in the format 000-00.0 E (or W)"
Target = "000-00.0 E"
GoTo Continue
End If
If Left(Target, 3) > 180 Then
MsgBox "Maximum allowable values are: 180-99.9"
Target = "000-00.0 E"
GoTo Continue
End If
End If
End If
Continue:
Application.EnableEvents = True
Exit Sub
Escape:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Continue
End Sub