View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Delete 4 to 5 digits from left in a cell

You need to put it in a macro, for instance

Sub RemoveData()
iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
With Cells(i,"A")
iPos = InStr(":",.Value)
if iPos 0 Then
.Value = Right(.Value, Len(.Value) - iPos)
End If
End With
Next i
End Sub

then run RemoveData

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"saziz" wrote in
message ...

Hi Bob,
I fix my problem, thank you. But wanted to try your code.
At this line: For i = 1 To Len(a) it gives me an error "Invalid outside
procedure"
I don't know what is.
Aziz


--
saziz
------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=536939