View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Text manipulation

Sub Test()
Dim iLastRow As Long
Dim i As Long, j As Long
Dim temp
Const nIndex As Long = 3 'every third, change to suit

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If nIndex = 1 Then
Cells(i, "A").Value = Right(Cells(i, "A").Value, _
Len(Cells(i, "A").Value) - 1)
Else
Cells(i, "A").Value = Left(Cells(i, "A").Value, nIndex - 1) & _
Right(Cells(i, "A").Value, Len(Cells(i,
"A").Value) - nIndex)
End If
Next i

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"paulinoluciano" wrote in message
ups.com...
"Is there some VBA code which could delete all first, second or third
characters of a text? Could it be done to the three last characters
from this same text and these be displayed on reverse order?"

Example:
AAAASAHDASK
AAASAHDASK
AASAHDASK
ASAHDASK
SADHASAAAA
ADHASAAAA
DHASAAAA