I'm just guessing that you narrowed the topic too much to English. As I understand it, it's more about differentiating between left-to-right or right-to-left text writing systems, depending on the language used.
Theoretically, if the cells have horizontal formatting set to General, texts written in different systems should automatically be pulled to the appropriate cell edge. So the macro seems unnecessary.
If the macro is necessary, below is the code to be placed in the sheet module (not in the standard module!). This is an event procedure that examines the changed cells in column E. Every character in each cell examined is checked. If the macro encounters a character belonging to the characters of the “right-to-left” system, the cell is formatted with the text pulled to the right. If no character belongs to the ranges listed in the function, the macro considers that we are dealing with the “left-to-right” system and the text will be pulled to the left edge of the cell.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Dim Cell As Range
Dim CellValue As Variant
Dim i As Long
Dim IsRightToLeftLanguage As Boolean
Set Rng = Intersect(Target, Me.Columns("E").Cells)
If Not Rng Is Nothing Then
Application.EnableEvents = True
For Each Cell In Rng
CellValue = Cell.Value
If Not IsNumeric(CellValue) Then
For i = 1 To Len(CellValue)
If IsRightToLeftLanguageChar(Mid(CellValue, i, 1)) Then
IsRightToLeftLanguage = True
Exit For
End If
Next i
End If
If IsRightToLeftLanguage Then
Cell.HorizontalAlignment = xlRight
Else
Cell.HorizontalAlignment = xlLeft
End If
Cell.VerticalAlignment = xlCenter
Next Cell
Application.EnableEvents = True
End If
End Sub
Private Function IsRightToLeftLanguageChar(ch As String) As Boolean
Dim code As Long
code = AscW(ch)
' Checking whether the character code belongs to one of the ranges
'languages:
' Arabic, Persian(Farsi), Urdu, Pashto &H600-&H6FF
' Hebrew &H590-&H5FF
' Syrian(Aramaic) &H700-&H74F
IsRightToLeftLanguageChar = ((code >= &H600 And code <= &H6FF) Or _
(code >= &H590 And code <= &H5FF) Or _
(code >= &H700 And code <= &H74F))
End Function
Artik