If I enter or paste one word or one number, it gives an error: "Runtime '9': Subscript out of range". It is necessary that one character can be entered, but without conversion. If remove values from a column, then the error also occurs: "Runtime '9': subscript out of range". Need to be able to delete values from cells. I need to be able to enter and paste everything, but not convert. Convert only (any number)m and (any number)M. Can delete and edit data in cells.
I have this macro:
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Column <> 1 Then Exit Sub
Dim v As Variant
v = Split(Target, " ")
If Right(Target, 1) <> "m" Then
Target = v(1) & " " & v(0)
End If
End Sub
This macro converts the data to (any number)m and (any number)M be on the right.
For example:
L3 280M
500m FMA
Nest 475m
340m Pr6
720M uT10
etc.
Convert to:
L3 280M
FMA 500m
Nest 475m
Pr6 340m
uT10 720M
etc.
UBound(V)=0
) or more. The error occurs precisely when accessing the element V(1) when it does not exist.